]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/ircd_signal.c
Move cmode +N to cmode +d, so that extensions/m_roleplay can retain cmode +N and...
[irc/rqf/shadowircd.git] / src / ircd_signal.c
index bbbe64b6fab2ee439ccbd1747aa43464038b1951..f861a3808247addb05b0d19df8e87712cabca956 100644 (file)
@@ -17,7 +17,6 @@
  *   along with this program; if not, write to the Free Software
  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
- * $Id: ircd_signal.c 6 2005-09-10 01:02:21Z nenolod $
  */
 
 #include "stdinc.h"
@@ -43,21 +42,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");
 }
 
 /*