From 7142872d2c6e0be42307671afa31016f6940007d Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Thu, 2 Oct 2008 09:17:49 -0400 Subject: [PATCH] Fix bug 5805: don't close stdout - When calling setup_logging multiple times, the code was closing the debug file descriptor before opening or assigning the new one. We don't, however, want to close the debug file descriptor if it is stdout. Derrell --- source/lib/debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lib/debug.c b/source/lib/debug.c index d835ea7c176..d91b55dd23b 100644 --- a/source/lib/debug.c +++ b/source/lib/debug.c @@ -578,7 +578,9 @@ void setup_logging(const char *pname, bool interactive) stdout_logging = False; if (dbf) { x_fflush(dbf); - (void) x_fclose(dbf); + if (dbf != x_stdout) { + (void) x_fclose(dbf); + } } dbf = NULL; -- 2.11.4.GIT