1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-01 15:06:38 +02:00

Don't stat() the logfile if user has no log::maxsize

This commit is contained in:
Bram Matthys
2021-03-08 09:51:00 +01:00
parent 7b655a5e17
commit 8a16a7392f
+1 -1
View File
@@ -162,7 +162,7 @@ void ircd_log(int flags, FORMAT_STRING(const char *format), ...)
#endif
if (logs->flags & flags)
{
if (stat(logs->file, &fstats) != -1 && logs->maxsize && fstats.st_size >= logs->maxsize)
if (logs->maxsize && (stat(logs->file, &fstats) != -1) && fstats.st_size >= logs->maxsize)
{
char oldlog[512];
if (logs->logfd == -1)