Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / ircd / ircd_log.c
index d40c7f1dae22fa41a38bc26f09aa4c379ba41691..ab65f3b563e1c6d26a50609b9efb0ecddd18317a 100644 (file)
@@ -627,15 +627,15 @@ log_set_file(const char *subsys, const char *filename)
   if (!(desc = log_find(subsys)))
     return 2;
 
-  /* no change, don't go to the trouble of destroying and recreating */
-  if (desc->file && filename && !strcmp(desc->file->file, filename))
-    return 0;
-
   if (filename)
     desc->mark |= LOG_MARK_FILE; /* mark that file has been changed */
   else
     desc->mark &= ~LOG_MARK_FILE; /* file has been reset to defaults */
 
+  /* no change, don't go to the trouble of destroying and recreating */
+  if (desc->file && filename && !strcmp(desc->file->file, filename))
+    return 0;
+
   /* debug log is special, since it has to be opened on fd 2 */
   if (desc->subsys == LS_DEBUG)
     return log_debug_file(filename);