]> 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 bbbe64b6fab2ee439ccbd1747aa43464038b1951..4ea20aaf6f0cf65dd7c7e1740824de1d5c66b333 100644 (file)
@@ -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");
 }
 
 /*