#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"
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");
}
/*