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

recoded ircd_log a bit

This commit is contained in:
codemastr
2001-04-13 22:38:37 +00:00
parent 155a99b69e
commit dea4e0f9b8
2 changed files with 5 additions and 8 deletions
+2
View File
@@ -409,3 +409,5 @@
- Possible FD leak in ircd_log, caused by some codemastr coding(TM)
- #define HELP_WHO for the "did a /who 0 o"
- Added a new Win32 GUI does it work, no one knows
- Rewrote the ircd_log function a bit to fix the FD bug better, not sure wtf I was smoking
when I wrote the last one :P
+3 -8
View File
@@ -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);
}