summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/inspircd.h2
-rw-r--r--src/cmd_rehash.cpp2
-rw-r--r--src/inspircd.cpp7
3 files changed, 10 insertions, 1 deletions
diff --git a/include/inspircd.h b/include/inspircd.h
index 4aa61e943..9f2ae630a 100644
--- a/include/inspircd.h
+++ b/include/inspircd.h
@@ -604,6 +604,8 @@ class InspIRCd : public classbase
*/
void OpenLog(char** argv, int argc);
+ void CloseLog();
+
/** Convert a user to a pseudoclient, disconnecting the real user
* @param user The user to convert
* @param message The quit message to display when exiting the user
diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp
index 52a304286..47554d5ac 100644
--- a/src/cmd_rehash.cpp
+++ b/src/cmd_rehash.cpp
@@ -35,6 +35,8 @@ CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
else
{
ServerInstance->WriteOpers("%s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(CONFIG_FILE));
+ ServerInstance->CloseLog();
+ ServerInstance->OpenLog(NULL,0);
ServerInstance->Config->Read(false,user);
}
if (old_disabled != ServerInstance->Config->DisabledCommands)
diff --git a/src/inspircd.cpp b/src/inspircd.cpp
index ceeaf6650..6b9359751 100644
--- a/src/inspircd.cpp
+++ b/src/inspircd.cpp
@@ -136,12 +136,17 @@ void InspIRCd::Start()
void InspIRCd::Rehash(int status)
{
SI->WriteOpers("Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(CONFIG_FILE));
- fclose(SI->Config->log_file);
+ SI->CloseLog();
SI->OpenLog(NULL,0);
SI->Config->Read(false,NULL);
FOREACH_MOD_I(SI,I_OnRehash,OnRehash(""));
}
+void InspIRCd::CloseLog()
+{
+ this->Logger->Close();
+}
+
void InspIRCd::SetSignals()
{
signal(SIGALRM, SIG_IGN);