]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
kvm tool: Exit init only when /bin/sh itself stops
authorSasha Levin <levinsasha928@gmail.com>
Mon, 26 Dec 2011 10:18:23 +0000 (12:18 +0200)
committerPekka Enberg <penberg@kernel.org>
Tue, 3 Jan 2012 07:19:48 +0000 (09:19 +0200)
Right now we wait for any of the children to stop, which means we might
exit before /bin/sh stopped.

Instead, wait only for the /bin/sh (or the sandboxed) process.

Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
tools/kvm/guest/init_stage2.c

index 7b96436a79162bd4037a77f1be4f8f0be5c6fda3..96bcfcd03d504faac1dc715edcc058ba6ce2b0a8 100644 (file)
@@ -48,7 +48,7 @@ int main(int argc, char *argv[])
                else
                        run_process("/bin/sh");
        } else {
-               wait(&status);
+               waitpid(child, &status, 0);
        }
 
        reboot(LINUX_REBOOT_CMD_RESTART);