X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/cc200171d7c40be3b204460f9c14d5d37e771866..cb097b8840594b6a77aab21d0b4c20f036a7d012:/src/ircd_signal.c diff --git a/src/ircd_signal.c b/src/ircd_signal.c index 906e4a4..4ea20aa 100644 --- a/src/ircd_signal.c +++ b/src/ircd_signal.c @@ -24,7 +24,7 @@ #include "ircd_signal.h" #include "ircd.h" /* dorehash */ #include "restart.h" /* server_reboot */ -#include "s_log.h" +#include "logger.h" #include "s_conf.h" #include "client.h" #include "send.h" @@ -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"); } /*