]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
make _db_init() re-callable
authorwessels <>
Tue, 16 Apr 1996 00:01:19 +0000 (00:01 +0000)
committerwessels <>
Tue, 16 Apr 1996 00:01:19 +0000 (00:01 +0000)
src/debug.cc

index e3000a4c31d0aafe17f16be36f9232b18d9b9aaf..102b3abdd62e0a12bd27461cf6a27433a01abe02 100644 (file)
@@ -1,5 +1,5 @@
 
-/* $Id: debug.cc,v 1.13 1996/04/14 03:06:33 wessels Exp $ */
+/* $Id: debug.cc,v 1.14 1996/04/15 18:01:19 wessels Exp $ */
 
 #include "squid.h"
 
@@ -112,6 +112,8 @@ static void debugOpenLog(logfile)
     if (debug_log_file)
        xfree(debug_log_file);
     debug_log_file = xstrdup(logfile); /* keep a static copy */
+    if (debug_log)
+       fclose(debug_log);
     debug_log = fopen(logfile, "a+");
     if (!debug_log) {
        fprintf(stderr, "WARNING: Cannot write log file: %s\n", logfile);
@@ -171,8 +173,6 @@ void _db_rotate_log()
     }
     /* Close and reopen the log.  It may have been renamed "manually"
      * before HUP'ing us. */
-    if (debug_log != stderr) {
-       fclose(debug_log);
+    if (debug_log != stderr)
        debugOpenLog(debug_log_file);
-    }
 }