From: splidge Date: Thu, 27 Mar 2008 10:12:10 +0000 (+0000) Subject: Made the core reopen the logfile on SIGUSR1 X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/3fe02fb2200f4870a3396e641612e38e9c5e3ff2 Made the core reopen the logfile on SIGUSR1 --- diff --git a/core/error.c b/core/error.c index 2a79a946..895e786c 100644 --- a/core/error.c +++ b/core/error.c @@ -34,8 +34,16 @@ char *sevtostring(int severity) { } } +void reopen_logfile(int hooknum, void *arg) { + if (logfile) + fclose(logfile); + + logfile=fopen("newserv.log","a"); +} + void init_logfile() { logfile=fopen("newserv.log","a"); + registerhook(HOOK_CORE_SIGUSR1, reopen_logfile); } void Error(char *source, int severity, char *reason, ... ) {