diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-23 16:40:09 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-12-23 16:40:09 +0000 |
commit | de3978c580edabe667d0845ed6027c9ff25e461b (patch) | |
tree | 1d49d99735e1b3ef50a5b42bee950e534ccabdf0 /src/helperfuncs.cpp | |
parent | e04f190f6377e76d2f3c5b0ece40507f19531ae7 (diff) |
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
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r-- | src/helperfuncs.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <die> 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"); |