summaryrefslogtreecommitdiff
path: root/source3/lib/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/debug.c')
-rw-r--r--source3/lib/debug.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source3/lib/debug.c b/source3/lib/debug.c
index f41c3b6497..c43a98f4fa 100644
--- a/source3/lib/debug.c
+++ b/source3/lib/debug.c
@@ -602,6 +602,12 @@ BOOL reopen_logs( void )
force_check_log_size();
(void)umask(oldumask);
+ /* Take over stderr to catch ouput into logs */
+ if (sys_dup2(dbf->fd, 2) == -1) {
+ close_low_fds(True); /* Close stderr too, if dup2 can't point it
+ at the logfile */
+ }
+
return ret;
}