* [PATCH] kvm tool: Exit init only when /bin/sh itself stops
@ 2011-12-26 10:18 Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2011-12-26 10:18 UTC (permalink / raw)
To: penberg; +Cc: mingo, gorcunov, asias.hejun, kvm, Sasha Levin
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>
---
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);
--
1.7.8.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-12-26 10:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-26 10:18 [PATCH] kvm tool: Exit init only when /bin/sh itself stops Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).