commit 36c5d0401606ef8927f304f2c3e70d67c5535648
parent 7f91cc8bcc5fe7b17c6193e49d25c19dbcf39637
Author: leitner <leitner>
Date: Thu, 6 Dec 2001 15:20:26 +0000
reap zombies faster.
Diffstat:
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/CHANGES b/CHANGES
@@ -1,3 +1,7 @@
+0.8:
+ call waitpid repeatedly until it returns "no children".
+ This reaps zombies faster.
+
0.7:
found and fixed the bug that made the logging support not work when
minit was running as PID 1.
diff --git a/minit.c b/minit.c
@@ -337,8 +337,10 @@ void childhandler() {
return;
}
#endif
- killed=waitpid(-1,&status,WNOHANG);
- handlekilled(killed);
+ do {
+ killed=waitpid(-1,&status,WNOHANG);
+ handlekilled(killed);
+ } while (killed && killed!=(pid_t)-1);
}
static volatile int dowinch=0;