summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-02 12:53:04 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-02 12:53:04 +0000
commite030b91bf8416654007daa1f493b36fb59cf5b58 (patch)
treef43fcee0f6cbe8f611d3bedc381f87f6f55dac38
parentb0851cb1c7d797e0f63c45cde66d4bc142d7be51 (diff)
downloadsamba-e030b91bf8416654007daa1f493b36fb59cf5b58.tar.gz
samba-e030b91bf8416654007daa1f493b36fb59cf5b58.tar.bz2
samba-e030b91bf8416654007daa1f493b36fb59cf5b58.zip
Call me parinoid, but I don't like the idea that we could ever have dbf point
to a closed file. Swap the assign and the close around. Andrew Bartlett (This used to be commit ceb2a7984910533187d3345440c24b605306e3cb)
-rw-r--r--source3/lib/debug.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index ea5bad3b6d..0836dbe790 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -555,6 +555,7 @@ BOOL reopen_logs( void )
pstring fname;
mode_t oldumask;
XFILE *new_dbf = NULL;
+ XFILE *old_dbf = NULL;
BOOL ret = True;
if (stdout_logging)
@@ -584,9 +585,10 @@ BOOL reopen_logs( void )
ret = False;
} else {
x_setbuf(new_dbf, NULL);
- if (dbf)
- (void) x_fclose(dbf);
+ old_dbf = dbf;
dbf = new_dbf;
+ if (old_dbf)
+ (void) x_fclose(old_dbf);
}
/* Fix from klausr@ITAP.Physik.Uni-Stuttgart.De