diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cmd_rehash.cpp | 2 | ||||
-rw-r--r-- | src/inspircd.cpp | 7 |
2 files changed, 8 insertions, 1 deletions
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); |