* Prevent zombies. Previous the SIGCHLD handler only reaped one

zombie at a time, so if multiple children died before the handler
  got to run, some of them would not be cleaned up.
This commit is contained in:
Eelco Dolstra 2008-11-14 16:50:01 +00:00
parent 6fedb7aa0f
commit 3f4ed681c2

View File

@ -534,7 +534,7 @@ static void processConnection()
static void sigChldHandler(int sigNo)
{
/* Reap all dead children. */
while (waitpid(-1, 0, WNOHANG) == 0) ;
while (waitpid(-1, 0, WNOHANG) > 0) ;
}