]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/server.cpp
Whoops, i left a value out of the array, and gcc didnt warn!
[user/henk/code/inspircd.git] / src / server.cpp
index 7f05aee7bdca6402b09e048afa8b31ce1b4360f3..f259e44359a8fefdd02992bceb12e4c4be9b74bd 100644 (file)
@@ -12,6 +12,7 @@
  */
 
 #include <signal.h>
+#include "exitcodes.h"
 #include "inspircd.h"
 
 
@@ -22,9 +23,25 @@ void InspIRCd::SignalHandler(int signal)
                case SIGHUP:
                        Rehash();
                        break;
+               case SIGTERM:
+                       Exit(signal);
+                       break;
        }
 }
 
+void InspIRCd::Exit(int status)
+{
+#ifdef WINDOWS
+       delete WindowsIPC;
+#endif
+       if (this)
+       {
+               this->SendError("Exiting with status " + ConvToStr(status) + " (" + std::string(ExitCodes[status]) + ")");
+               this->Cleanup();
+    }
+    exit (status);
+}
+
 void InspIRCd::Rehash()
 {
        this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName));