diff options
author | Derrell Lipman <derrell.lipman@unwireduniverse.com> | 2008-10-02 09:17:49 -0400 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2008-10-06 13:03:11 +0200 |
commit | a937de4a626a8084e852bf7d345441bab15963cd (patch) | |
tree | e3d0804969c2e45291ea0f251c2967cf7f9cb128 /source | |
parent | a2f298883f21c3e9afe686ee393410f2bcb28370 (diff) | |
download | samba-a937de4a626a8084e852bf7d345441bab15963cd.tar.gz samba-a937de4a626a8084e852bf7d345441bab15963cd.tar.xz samba-a937de4a626a8084e852bf7d345441bab15963cd.zip |
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
(cherry picked from commit 7142872d2c6e0be42307671afa31016f6940007d)
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/debug.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; |