]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Fix bug 5805: don't close stdout
authorDerrell Lipman <derrell.lipman@unwireduniverse.com>
Thu, 2 Oct 2008 13:17:49 +0000 (09:17 -0400)
committerDerrell Lipman <derrell.lipman@unwireduniverse.com>
Thu, 2 Oct 2008 13:18:27 +0000 (09:18 -0400)
- 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

index d835ea7c176e5a824b387a587f21ba94991bf6e5..d91b55dd23b70c150b4ee26c0b98dae7eddee830 100644 (file)
@@ -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;