summaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-23 09:10:20 +0000
committerspecial <special@e03df62e-2008-0410-955e-edbf42e46eb7>2006-10-23 09:10:20 +0000
commitb0b809d0003099876ec8c89c939695ef00afe294 (patch)
tree5a3340626d6c64a6a5ce8b98ded9c7c2392d9bdd /src/helperfuncs.cpp
parentc56dc5f7b6df6e96a82913ffdae739a3095d69c4 (diff)
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
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp15
1 files 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);
}