diff options
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -599,7 +599,9 @@ debug_logprintf (const char *fmt, ...) struct logvprintf_state lpstate; bool done; +#ifndef TESTING check_redirect_output (); +#endif if (inhibit_logging) return; @@ -676,9 +678,16 @@ log_close (void) { int i; - if (logfp && (logfp != stderr)) - fclose (logfp); + if (logfp && logfp != stderr && logfp != stdout) + { + if (logfp == stdlogfp) + stdlogfp = NULL; + if (logfp == filelogfp) + filelogfp = NULL; + fclose (logfp); + } logfp = NULL; + inhibit_logging = true; save_context_p = false; |