nspawn: save errno before reopening log after exec failure
authorMichal Schmidt <mschmidt@redhat.com>
Thu, 5 Nov 2015 12:44:12 +0000 (13:44 +0100)
committerMichal Schmidt <mschmidt@redhat.com>
Thu, 5 Nov 2015 12:44:12 +0000 (13:44 +0100)
src/nspawn/nspawn.c

index 699a013..0a8ea84 100644 (file)
@@ -2585,8 +2585,9 @@ static int inner_child(
                 execle("/bin/sh", "-sh", NULL, env_use);
         }
 
+        r = -errno;
         (void) log_open();
-        return log_error_errno(errno, "execv() failed: %m");
+        return log_error_errno(r, "execv() failed: %m");
 }
 
 static int outer_child(