reap all zombie children, promted by bug report from Patrik Lundin

This commit is contained in:
Love Hornquist Astrand
2010-10-27 19:34:28 -07:00
parent 01e03a1c1e
commit 2a2b229efc

View File

@@ -92,7 +92,12 @@ static RETSIGTYPE
sigchld(int sig)
{
int status;
waitpid(-1, &status, 0);
/*
* waitpid() is async safe. will return -1 or 0 on no more zombie
* children
*/
while ((waitpid(-1, &status, WNOHANG)) > 0)
;
SIGRETURN(0);
}