]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/ircd_signal.c
autogen.sh is not necessary at this time, and did not work anyway.
[irc/rqf/shadowircd.git] / src / ircd_signal.c
index e910505ffe78c72dc5c9f58033e07a648185f22d..4ea20aaf6f0cf65dd7c7e1740824de1d5c66b333 100644 (file)
@@ -24,9 +24,7 @@
 #include "ircd_signal.h"
 #include "ircd.h"              /* dorehash */
 #include "restart.h"           /* server_reboot */
-#include "s_log.h"
-#include "memory.h"
-#include "commio.h"
+#include "logger.h"
 #include "s_conf.h"
 #include "client.h"
 #include "send.h"
@@ -45,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");
 }
 
 /*