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> --- 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 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html