]> jfr.im git - solanum.git/blobdiff - ircd/ircd_signal.c
send: add sendto_one_multiline_* API
[solanum.git] / ircd / ircd_signal.c
index 0cae2c36ae5594dcb47625af51c5f20f4ee2811e..2c4070c1fe22246b6fc87eb0381fd5a43dc2bea1 100644 (file)
 #include "client.h"
 #include "send.h"
 
+#ifndef _WIN32
+
+#include <sys/types.h>
+#include <sys/wait.h>
+
 /*
  * dummy_handler - don't know if this is really needed but if alarm is still
  * being used we probably will
@@ -52,6 +57,9 @@ sigchld_handler(int sig)
 /*
  * sigterm_handler - exit the server
  */
+static void
+sigterm_handler(int sig) __attribute__((noreturn));
+
 static void
 sigterm_handler(int sig)
 {
@@ -64,7 +72,7 @@ sigterm_handler(int sig)
 static void
 sighup_handler(int sig)
 {
-       dorehash = 1;
+       dorehash = true;
 }
 
 /*
@@ -73,13 +81,13 @@ sighup_handler(int sig)
 static void
 sigusr1_handler(int sig)
 {
-       doremotd = 1;
+       doremotd = true;
 }
 
 static void
 sigusr2_handler(int sig)
 {
-       dorehashbans = 1;
+       dorehashbans = true;
 }
 
 /*
@@ -88,7 +96,7 @@ sigusr2_handler(int sig)
 static void
 sigint_handler(int sig)
 {
-       static int restarting = 0;
+       static bool restarting = false;
 
        if(server_state_foreground)
        {
@@ -98,9 +106,9 @@ sigint_handler(int sig)
        else
        {
                ilog(L_MAIN, "Server Restarting on SIGINT");
-               if(restarting == 0)
+               if(!restarting)
                {
-                       restarting = 1;
+                       restarting = true;
                        server_reboot();
                }
        }
@@ -171,3 +179,17 @@ setup_signals()
 
        sigprocmask(SIG_UNBLOCK, &sigs, NULL);
 }
+
+#else
+void
+setup_signals()
+{
+/* this is a stub for mingw32 */
+}
+
+void
+setup_reboot_signals()
+{
+/* this is a stub for mingw32 */
+}
+#endif