Commit-ID: 2a3e890d39933f089eb12d10490fad7941db4d7a Gitweb: http://git.kernel.org/tip/2a3e890d39933f089eb12d10490fad7941db4d7a Author: Sasha Levin <levinsasha928@xxxxxxxxx> AuthorDate: Mon, 26 Dec 2011 12:18:23 +0200 Committer: Pekka Enberg <penberg@xxxxxxxxxx> CommitDate: Tue, 3 Jan 2012 09:19:48 +0200 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@xxxxxxxxx> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx> --- tools/kvm/guest/init_stage2.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/tools/kvm/guest/init_stage2.c b/tools/kvm/guest/init_stage2.c index 7b96436..96bcfcd 100644 --- a/tools/kvm/guest/init_stage2.c +++ b/tools/kvm/guest/init_stage2.c @@ -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); -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html