diff --git a/Changes b/Changes index 8bc7b288a..8e93da732 100644 --- a/Changes +++ b/Changes @@ -824,3 +824,4 @@ seen. gmtime warning still there - Fixed something that could cause a possible bug in /oper ? - log::maxsize can now be entered in the format 1MB, 1MegaByte, 1MByte, etc (KB,MB,GB,TB are the only sizes recognized) +- Fixed a bug where log::maxsize would say it started a new log file if the log file didn't exist diff --git a/src/s_extra.c b/src/s_extra.c index fa079cfc6..8529d6736 100644 --- a/src/s_extra.c +++ b/src/s_extra.c @@ -433,8 +433,7 @@ void ircd_log(int flags, char *format, ...) sprintf(timebuf, "[%s] - ", myctime(TStime())); for (logs = conf_log; logs; logs = (ConfigItem_log *) logs->next) { if (logs->flags & flags) { - stat(logs->file, &fstats); - if (logs->maxsize && fstats.st_size >= logs->maxsize) { + if (stat(logs->file, &fstats) != -1 && logs->maxsize && fstats.st_size >= logs->maxsize) { #ifndef _WIN32 fd = open(logs->file, O_CREAT|O_WRONLY|O_TRUNC, S_IRUSR|S_IWUSR); #else