From b0b809d0003099876ec8c89c939695ef00afe294 Mon Sep 17 00:00:00 2001 From: special Date: Mon, 23 Oct 2006 09:10:20 +0000 Subject: Give some actual information when the log file fails to open git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5530 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/helperfuncs.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index d8e718e48..c09b714f1 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -446,26 +446,17 @@ void InspIRCd::OpenLog(char** argv, int argc) { Config->logpath = ServerConfig::GetFullProgDir(argv,argc) + "/ircd.log"; } + + Config->log_file = fopen(Config->logpath.c_str(),"a+"); } else { Config->log_file = fopen(this->LogFileName,"a+"); - - if (!Config->log_file) - { - printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str()); - Exit(ERROR); - } - - this->Logger = new FileLogger(this, Config->log_file); - return; } - Config->log_file = fopen(Config->logpath.c_str(),"a+"); - if (!Config->log_file) { - printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str()); + printf("ERROR: Could not write to logfile %s: %s\n\n", Config->logpath.c_str(), strerror(errno)); Exit(ERROR); } -- cgit v1.2.3