Under load it's possible multiple child processes have been killed before
we start processing the SIGCHILD signal, leaving zombie processes behind
everytime we miss a process.
Reap as many processes as possible instead of assuming one handler
call = one process like we currently did.
Can be reproduced by running the following commands in parallel:
- tcpdump -i lo -w /tmp/test -C 1 -z /usr/bin/true
- iperf3 -s
- iperf3 -c localhost
static void
child_cleanup(int signo _U_)
{
- wait(NULL);
+ while (waitpid(-1, NULL, WNOHANG) >= 0);
}
#endif /* HAVE_FORK && HAVE_VFORK */