summaryrefslogtreecommitdiff
path: root/source3/web/swat.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-10-29 14:19:32 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-11-02 04:36:04 +0000
commit9da4ace1d9789d300ab298bc34694c44b2062f30 (patch)
tree0c4ce1fa4f3a97934c9504263fdfc86a28e39705 /source3/web/swat.c
parent4ae27891f8ac0a56d68b0544e78d6c17ade0c1c9 (diff)
downloadsamba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.gz
samba-9da4ace1d9789d300ab298bc34694c44b2062f30.tar.bz2
samba-9da4ace1d9789d300ab298bc34694c44b2062f30.zip
s3-debug Impove setup_logging() to specify logging to stderr
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
Diffstat (limited to 'source3/web/swat.c')
-rw-r--r--source3/web/swat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/web/swat.c b/source3/web/swat.c
index 1250204d03..531cf3f411 100644
--- a/source3/web/swat.c
+++ b/source3/web/swat.c
@@ -1413,12 +1413,12 @@ const char *lang_msg_rotate(TALLOC_CTX *ctx, const char *msgid)
/* we don't want any SIGPIPE messages */
BlockSignals(True,SIGPIPE);
- dbf = x_fopen("/dev/null", O_WRONLY, 0);
- if (!dbf) dbf = x_stderr;
+ debug_set_logfile("/dev/null");
/* we don't want stderr screwing us up */
close(2);
open("/dev/null", O_WRONLY);
+ setup_logging("swat", DEBUG_FILE);
pc = poptGetContext("swat", argc, (const char **) argv, long_options, 0);
@@ -1429,9 +1429,10 @@ const char *lang_msg_rotate(TALLOC_CTX *ctx, const char *msgid)
poptFreeContext(pc);
load_case_tables();
-
- setup_logging(argv[0],False);
+
+ /* This should set a more apporiate log file */
load_config(True);
+ reopen_logs();
load_interfaces();
iNumNonAutoPrintServices = lp_numservices();
load_printers(server_event_context(), server_messaging_context());