mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-07-09 18:23:12 +02:00
recoded ircd_log a bit
This commit is contained in:
+3
-8
@@ -411,19 +411,14 @@ void ircd_log(int flags, char *format, ...)
|
||||
strcat(buf, "\n");
|
||||
sprintf(timebuf, "[%s] - ", myctime(TStime()));
|
||||
for (logs = conf_log; logs; logs = (ConfigItem_log *) logs->next) {
|
||||
fd = open(logs->file, O_CREAT|O_APPEND|O_WRONLY, S_IRUSR|S_IWUSR);
|
||||
if (fd == -1)
|
||||
continue;
|
||||
if (logs->flags & flags) {
|
||||
fd = open(logs->file, O_CREAT|O_APPEND|O_WRONLY, S_IRUSR|S_IWUSR);
|
||||
if (fd == -1)
|
||||
continue;
|
||||
write(fd, timebuf, strlen(timebuf));
|
||||
write(fd, buf, strlen(buf));
|
||||
close(fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* anti-codemastr(TM) coding */
|
||||
close(fd);
|
||||
}
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user