mirror of
https://github.com/clearlinux/kvmtool.git
synced 2026-08-19 03:47:27 +00:00
kvm tools: fix zombie reaping in guest/init.c
init.c is not very kind with processes that get reparented when their own parent die, leaving them hanging around. Looking at the code, it only seem to care about its own flesh and blood. Bad init. Teach it some basic zombie reaping skills. Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
committed by
Will Deacon
parent
a1166a18a9
commit
1ad95468d8
+5
-1
@@ -61,7 +61,11 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
run_process("/bin/sh");
|
||||
} else {
|
||||
waitpid(child, &status, 0);
|
||||
pid_t corpse;
|
||||
|
||||
do {
|
||||
corpse = waitpid(-1, &status, 0);
|
||||
} while (corpse != child);
|
||||
}
|
||||
|
||||
reboot(LINUX_REBOOT_CMD_RESTART);
|
||||
|
||||
Reference in New Issue
Block a user