summaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 19:46:25 +0000
committerpeavey <peavey@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-25 19:46:25 +0000
commiteadd5cce87ff5d17a3506bc0750e21e3d5035143 (patch)
tree88c7b53402a664e927a3a22ab88414bab3f79eb0 /src/server.cpp
parentc39ccd1fdaef9ac6fd62888badc0240e8a88c55a (diff)
Rehash from console works again due to new signalhandler. TODO: Use this to catch SIGTERM and exit cleanly.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7571 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/src/server.cpp b/src/server.cpp
index 2ab452fc8..7f05aee7b 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -11,22 +11,32 @@
* ---------------------------------------------------
*/
+#include <signal.h>
#include "inspircd.h"
-void InspIRCd::Rehash(int status)
+
+void InspIRCd::SignalHandler(int signal)
+{
+ switch (signal)
+ {
+ case SIGHUP:
+ Rehash();
+ break;
+ }
+}
+
+void InspIRCd::Rehash()
{
-/*
- SI->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(SI->ConfigFileName));
- SI->CloseLog();
- SI->OpenLog(SI->Config->argv, SI->Config->argc);
- SI->RehashUsersAndChans();
- FOREACH_MOD_I(SI, I_OnGarbageCollect, OnGarbageCollect());
- SI->Config->Read(false,NULL);
- SI->ResetMaxBans();
- SI->Res->Rehash();
- FOREACH_MOD_I(SI,I_OnRehash,OnRehash(NULL,""));
- SI->BuildISupport();
-*/
+ this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName));
+ this->CloseLog();
+ this->OpenLog(this->Config->argv, this->Config->argc);
+ this->RehashUsersAndChans();
+ FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect());
+ this->Config->Read(false,NULL);
+ this->ResetMaxBans();
+ this->Res->Rehash();
+ FOREACH_MOD_I(this,I_OnRehash,OnRehash(NULL,""));
+ this->BuildISupport();
}
void InspIRCd::RehashServer()