1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-09 11:53:13 +02:00

Fixed a log::maxsize bug where it would screw up when the file didn't exist

This commit is contained in:
codemastr
2001-08-24 20:44:33 +00:00
parent 2386f8d835
commit 5cd4cb01f8
2 changed files with 2 additions and 2 deletions
+1
View File
@@ -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
+1 -2
View File
@@ -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