X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/d3455e2c7e2f9040e1b7628d9cf52b26a24dcefc..377b98f0794834938a3fc1e5959236a7927d19d7:/src/ircd_signal.c diff --git a/src/ircd_signal.c b/src/ircd_signal.c index bbbe64b..4ea20aa 100644 --- a/src/ircd_signal.c +++ b/src/ircd_signal.c @@ -43,21 +43,21 @@ 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 */ static void sigterm_handler(int sig) { - /* XXX we had a flush_connections() here - we should close all the - * connections and flush data. read server_reboot() for my explanation. - * -- adrian - */ - ilog(L_MAIN, "Server killed By SIGTERM"); - exit(-1); + ircd_shutdown("Received SIGTERM"); } /*