From 43d549b4e105083811430c5e4275f2fa077657d7 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 14 Oct 2007 14:14:15 +0000 Subject: [PATCH] move opening of log before opening of config so that failure to open the config can be logged git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8179 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index fedc8149f..3149d74ea 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -397,6 +397,14 @@ InspIRCd::InspIRCd(int argc, char** argv) ChangeWindowsSpecificPointers(this); #endif + strlcpy(Config->MyExecutable,argv[0],MAXBUF); + + if (!this->OpenLog(argv, argc)) + { + printf("ERROR: Could not open logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno)); + Exit(EXIT_STATUS_LOG); + } + if (!ServerConfig::FileExists(this->ConfigFileName)) { printf("ERROR: Cannot open config file: %s\nExiting...\n", this->ConfigFileName); @@ -414,14 +422,6 @@ InspIRCd::InspIRCd(int argc, char** argv) Config->forcedebug = do_debug; Config->writelog = !do_nolog; - strlcpy(Config->MyExecutable,argv[0],MAXBUF); - - if (!this->OpenLog(argv, argc)) - { - printf("ERROR: Could not open logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno)); - Exit(EXIT_STATUS_LOG); - } - this->Modules = new ModuleManager(this); this->stats = new serverstats(); this->Timers = new TimerManager(this); -- 2.39.5