summaryrefslogtreecommitdiff
path: root/src/cmd_rehash.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 19:57:02 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2007-08-23 19:57:02 +0000
commit443b0f9645d861ca47a6f041a46703e27da7c0c8 (patch)
treeb87e52ce40b681dea0127d4d5375a88d5fad8d8e /src/cmd_rehash.cpp
parentab7a861a91fd204603775b8d06b1d99c1593229f (diff)
Raft of fixes so that inspircd can call Cleanup() and Exit() in less 'stable' circumstances, e.g. when half initialized, and it wont segfault.
Also fix OpenLog to not always exit on error, but to return a bool instead, which is much more friendly on rehash (you don't want /REHASH dieing your server if you cant write the log!) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7804 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/cmd_rehash.cpp')
-rw-r--r--src/cmd_rehash.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd_rehash.cpp b/src/cmd_rehash.cpp
index 34789b0ea..6e214be0a 100644
--- a/src/cmd_rehash.cpp
+++ b/src/cmd_rehash.cpp
@@ -37,7 +37,8 @@ CmdResult cmd_rehash::Handle (const char** parameters, int pcnt, userrec *user)
{
ServerInstance->WriteOpers("*** %s is rehashing config file %s",user->nick,ServerConfig::CleanFilename(ServerInstance->ConfigFileName));
ServerInstance->CloseLog();
- ServerInstance->OpenLog(ServerInstance->Config->argv, ServerInstance->Config->argc);
+ if (!ServerInstance->OpenLog(ServerInstance->Config->argv, ServerInstance->Config->argc))
+ user->WriteServ("*** NOTICE %s :ERROR: Could not open logfile %s: %s", user->nick, ServerInstance->Config->logpath.c_str(), strerror(errno));
ServerInstance->RehashUsersAndChans();
FOREACH_MOD(I_OnGarbageCollect, OnGarbageCollect());
ServerInstance->Config->Read(false,user);