kvm tool: Exit init only when /bin/sh itself stops

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>
This commit is contained in:
Sasha Levin
2011-12-26 12:18:23 +02:00
committed by Will Deacon
parent 0579e1d7d9
commit 5e048c182e
+1 -1
View 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);