]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/logger.c
Make genssl.sh work.
[irc/rqf/shadowircd.git] / src / logger.c
index 3fea75b58e4f4d67353d8aedee480d85a003c4c3..56af880c22036ac18a4a3953eff77159a7f14afb 100644 (file)
@@ -38,7 +38,6 @@
 #include "ircd_defs.h"
 #include "logger.h"
 #include "s_conf.h"
-#include "sprintf_irc.h"
 #include "send.h"
 #include "client.h"
 #include "s_serv.h"
@@ -86,26 +85,37 @@ open_logfiles(void)
 {
        int i;
 
-       if(log_main != NULL)
-               fclose(log_main);
+       close_logfiles();
 
        log_main = fopen(logFileName, "a");
 
        /* log_main is handled above, so just do the rest */
        for(i = 1; i < LAST_LOGFILE; i++)
        {
-               /* close open logfiles */
+               /* reopen those with paths */
+               if(!EmptyString(*log_table[i].name))
+                       *log_table[i].logfile = fopen(*log_table[i].name, "a");
+       }
+}                      
+
+void
+close_logfiles(void)
+{
+       int i;
+
+       if(log_main != NULL)
+               fclose(log_main);
+
+       /* log_main is handled above, so just do the rest */
+       for(i = 1; i < LAST_LOGFILE; i++)
+       {
                if(*log_table[i].logfile != NULL)
                {
                        fclose(*log_table[i].logfile);
                        *log_table[i].logfile = NULL;
                }
-
-               /* reopen those with paths */
-               if(!EmptyString(*log_table[i].name))
-                       *log_table[i].logfile = fopen(*log_table[i].name, "a");
        }
-}                      
+}
 
 void
 ilog(ilogfile dest, const char *format, ...)
@@ -128,6 +138,7 @@ ilog(ilogfile dest, const char *format, ...)
        {
                fclose(logfile);
                *log_table[dest].logfile = NULL;
+               return;
        }
 
        fflush(logfile);