summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-03-29 14:41:58 +1100
committerAndrew Tridgell <tridge@samba.org>2011-03-29 07:03:58 +0200
commitaf31bf6bf5ef3af6eaf87ebe2f9f5903698c22db (patch)
treec727b8c01d9df23833a0c2c3a152eca4a1d80d82 /lib/util
parent335189792448a209f1f654c6173f359f17ae7fb1 (diff)
downloadsamba-af31bf6bf5ef3af6eaf87ebe2f9f5903698c22db.tar.gz
samba-af31bf6bf5ef3af6eaf87ebe2f9f5903698c22db.tar.bz2
samba-af31bf6bf5ef3af6eaf87ebe2f9f5903698c22db.zip
debug: ignore debug_set_logfile() with a blank string
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Mar 29 07:03:58 CEST 2011 on sn-devel-104
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/debug.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index c7ba19e3cc..2ff7cb2c58 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -493,6 +493,10 @@ void setup_logging(const char *prog_name, enum debug_logtype new_logtype)
void debug_set_logfile(const char *name)
{
+ if (name == NULL || *name == 0) {
+ /* this copes with calls when smb.conf is not loaded yet */
+ return;
+ }
TALLOC_FREE(state.debugf);
state.debugf = talloc_strdup(NULL, name);
}
@@ -564,7 +568,7 @@ bool reopen_logs_internal(void)
if (new_fd == -1) {
log_overflow = true;
- DEBUG(0, ("Unable to open new log file %s: %s\n", state.debugf, strerror(errno)));
+ DEBUG(0, ("Unable to open new log file '%s': %s\n", state.debugf, strerror(errno)));
log_overflow = false;
ret = false;
} else {