summaryrefslogtreecommitdiff
path: root/lib/util/debug.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-07-18 17:07:25 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-07-20 09:17:09 +1000
commit485898458a1f786febd400be30bb3917fe5f71eb (patch)
tree9ec865e0baddf3e65960e329a812f35bd3a093b1 /lib/util/debug.c
parent3c9d01e3e58e2217915317406541ac8c6f6dcf92 (diff)
downloadsamba-485898458a1f786febd400be30bb3917fe5f71eb.tar.gz
samba-485898458a1f786febd400be30bb3917fe5f71eb.tar.bz2
samba-485898458a1f786febd400be30bb3917fe5f71eb.zip
debug: log early messages to stdout, and keep it open
The --log-stdout option was compromised by the log file descriptors being closed once the file process forked. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r--lib/util/debug.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index c1b33de6d1..cc57ba8419 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -514,6 +514,11 @@ bool debug_get_output_is_stderr(void)
return (state.logtype == DEBUG_DEFAULT_STDERR) || (state.logtype == DEBUG_STDERR);
}
+bool debug_get_output_is_stdout(void)
+{
+ return (state.logtype == DEBUG_DEFAULT_STDOUT) || (state.logtype == DEBUG_STDOUT);
+}
+
/**************************************************************************
reopen the log files
note that we now do this unconditionally
@@ -542,6 +547,7 @@ bool reopen_logs_internal(void)
switch (state.logtype) {
case DEBUG_STDOUT:
+ case DEBUG_DEFAULT_STDOUT:
debug_close_fd(state.fd);
state.fd = 1;
return true;