From de3978c580edabe667d0845ed6027c9ff25e461b Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 23 Dec 2006 16:40:09 +0000 Subject: Fix bug in m_dnsbl, a condition is always matched because someone was using unsigned int to check a return val that can be -1 *slap w00t* Change around the way exit codes are formed so that we can return a sensible exit code that reflects why inspircd exited git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@6076 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 9ddfe338f..4f303d32c 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -19,6 +19,7 @@ #include "mode.h" #include "xline.h" #include "inspircd.h" +#include "exitcodes.h" static char TIMESTR[26]; static time_t LAST = 0; @@ -448,7 +449,7 @@ void InspIRCd::OpenLog(char** argv, int argc) if (!Config->log_file) { printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno)); - Exit(ERROR); + Exit(EXIT_STATUS_LOG); } this->Logger = new FileLogger(this, Config->log_file); @@ -460,7 +461,7 @@ void InspIRCd::CheckRoot() { printf("WARNING!!! You are running an irc server as ROOT!!! DO NOT DO THIS!!!\n\n"); this->Log(DEFAULT,"Cant start as root"); - Exit(ERROR); + Exit(EXIT_STATUS_ROOT); } } @@ -470,7 +471,7 @@ void InspIRCd::CheckDie() { printf("WARNING: %s\n\n",Config->DieValue); this->Log(DEFAULT,"Died because of tag: %s",Config->DieValue); - Exit(ERROR); + Exit(EXIT_STATUS_DIETAG); } } @@ -490,7 +491,7 @@ void InspIRCd::LoadAllModules() { this->Log(DEFAULT,"There was an error loading a module: %s", this->ModuleError()); printf("\nThere was an error loading a module: %s\n\n",this->ModuleError()); - Exit(ERROR); + Exit(EXIT_STATUS_MODULE); } } printf("\nA total of \033[1;32m%d\033[0m module%s been loaded.\n", this->ModCount+1, this->ModCount+1 == 1 ? " has" : "s have"); -- cgit v1.3.1-10-gc9f91