1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

cleanup: explicit check for nonnull pointer

Since execvp requires nonnull args - add explicit check.
This commit is contained in:
Zdenek Kabelac 2013-04-19 21:10:19 +02:00
parent dd4fdce16c
commit dfca5dac9c
2 changed files with 3 additions and 3 deletions

View File

@ -54,7 +54,6 @@ int exec_cmd(struct cmd_context *cmd, const char *const argv[],
int status;
char buf[PATH_MAX * 2];
if (rstatus)
*rstatus = -1;
@ -76,6 +75,7 @@ int exec_cmd(struct cmd_context *cmd, const char *const argv[],
/* FIXME Fix effect of reset_locking on cache then include this */
/* destroy_toolcontext(cmd); */
/* FIXME Use execve directly */
if (argv[0])
execvp(argv[0], (char **) argv);
log_sys_error("execvp", argv[0]);
_exit(errno);

View File

@ -1499,7 +1499,7 @@ int lvm2_main(int argc, char **argv)
return -1;
if (is_static() && strcmp(base, "lvm.static") &&
path_exists(LVM_SHARED_PATH) &&
path_exists(LVM_SHARED_PATH) && argv &&
!getenv("LVM_DID_EXEC")) {
if (setenv("LVM_DID_EXEC", base, 1))
log_sys_error("setenv", "LVM_DID_EXEC");