diff --git a/src/ircd_signal.c b/src/ircd_signal.c index bbbe64b..0a02c09 100644 --- a/src/ircd_signal.c +++ b/src/ircd_signal.c @@ -43,9 +43,14 @@ dummy_handler(int sig) static void sigchld_handler(int sig) { - int status; - waitpid(-1, &status, WNOHANG); + int status, olderrno; + + olderrno = errno; + while (waitpid(-1, &status, WNOHANG) > 0) + ; + errno = olderrno; } + /* * sigterm_handler - exit the server */