* 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:
@@ -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) ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user