From 443b0f9645d861ca47a6f041a46703e27da7c0c8 Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 23 Aug 2007 19:57:02 +0000 Subject: 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 --- src/server.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/server.cpp') diff --git a/src/server.cpp b/src/server.cpp index f259e4435..b3b02f507 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -46,7 +46,8 @@ void InspIRCd::Rehash() { this->WriteOpers("*** Rehashing config file %s due to SIGHUP",ServerConfig::CleanFilename(this->ConfigFileName)); this->CloseLog(); - this->OpenLog(this->Config->argv, this->Config->argc); + if (!this->OpenLog(this->Config->argv, this->Config->argc)) + this->WriteOpers("*** ERROR: Could not open logfile %s: %s", Config->logpath.c_str(), strerror(errno)); this->RehashUsersAndChans(); FOREACH_MOD_I(this, I_OnGarbageCollect, OnGarbageCollect()); this->Config->Read(false,NULL); -- cgit v1.3.1-10-gc9f91