summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 20:23:18 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 20:23:18 +0000
commit0bb707c10c04621f9eb8fdf5211bec8156dbca11 (patch)
treeeea721afa38842c6afdd33ff4a0c3c650c42e491 /src/server.cpp
parenteadd5cce87ff5d17a3506bc0750e21e3d5035143 (diff)
Un-static InspIRCd::Exit and use SignalHandler instead.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7572 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 7f05aee7b..0f931da07 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -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
+ CloseIPC();
+#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));