summaryrefslogtreecommitdiff
path: root/src/userprocess.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/userprocess.cpp')
-rw-r--r--src/userprocess.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/userprocess.cpp b/src/userprocess.cpp
index fae96721d..c53aaab0b 100644
--- a/src/userprocess.cpp
+++ b/src/userprocess.cpp
@@ -70,6 +70,7 @@ extern std::vector<InspSocket*> module_sockets;
extern time_t TIME;
extern time_t OLDTIME;
extern std::vector<userrec*> local_users;
+char LOG_FILE[MAXBUF];
extern InspIRCd* ServerInstance;
extern ServerConfig *Config;
@@ -364,9 +365,21 @@ void DoBackgroundUserStuff(time_t TIME)
void OpenLog(char** argv, int argc)
{
- if (Config->logpath == "")
+ if (!*LOG_FILE)
{
- Config->logpath = GetFullProgDir(argv,argc) + "/ircd.log";
+ if (Config->logpath == "")
+ {
+ Config->logpath = GetFullProgDir(argv,argc) + "/ircd.log";
+ }
+ }
+ else
+ {
+ Config->log_file = fopen(LOG_FILE,"a+");
+ if (!Config->log_file)
+ {
+ printf("ERROR: Could not write to logfile %s, bailing!\n\n",Config->logpath.c_str());
+ Exit(ERROR);
+ }
}
Config->log_file = fopen(Config->logpath.c_str(),"a+");
if (!Config->log_file)