]> sourceware.org Git - lvm2.git/commitdiff
Log sys errors
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 1 Mar 2012 21:17:29 +0000 (21:17 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 1 Mar 2012 21:17:29 +0000 (21:17 +0000)
tools/lvmcmdline.c

index 874f5bd067f4757ead9e199dc3dac8483a871a50..0a0d05795bc4b658c6e107337a416806b59e7cc0 100644 (file)
@@ -1390,9 +1390,12 @@ int lvm2_main(int argc, char **argv)
        if (is_static() && strcmp(base, "lvm.static") &&
            path_exists(LVM_SHARED_PATH) &&
            !getenv("LVM_DID_EXEC")) {
-               setenv("LVM_DID_EXEC", base, 1);
-               execvp(LVM_SHARED_PATH, argv);
-               unsetenv("LVM_DID_EXEC");
+               if (setenv("LVM_DID_EXEC", base, 1))
+                       log_sys_error("setenv", "LVM_DID_EXEC");
+               if (execvp(LVM_SHARED_PATH, argv) == -1)
+                       log_sys_error("execvp", "LVM_SHARED_PATH");
+               if (unsetenv("LVM_DID_EXEC"))
+                       log_sys_error("unsetenv", "LVM_DID_EXEC");
        }
 
        /* "version" command is simple enough so it doesn't need any complex init */
This page took 0.032818 seconds and 5 git commands to generate.