summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 5bff9c2..d879dff 100644
--- a/src/log.c
+++ b/src/log.c
@@ -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;