diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-23 17:08:02 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-23 17:08:02 +0000 |
commit | 6cc7cd76fbc809d6c0df55c061684581e31b6ebc (patch) | |
tree | 24cdf1a0c83998d30d15cde8ffcb3606349440a5 /src | |
parent | 6c9a69cbad71e15788cc4d5757b5ee7d311bff70 (diff) |
Close logfile on rehash and reopen (it was only doing this on sighup for some reason)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6079 e03df62e-2008-0410-955e-edbf42e46eb7
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); |