From: Guus Sliepen Date: Sat, 14 Mar 2015 12:02:06 +0000 (+0000) Subject: Fix the case where we detach and use --logfile. X-Git-Tag: release-1.1pre12~195 X-Git-Url: https://git.tinc-vpn.org/git/browse?a=commitdiff_plain;h=15ad628f06895175d7e629ce0188805dc00159fd;p=tinc Fix the case where we detach and use --logfile. --- diff --git a/src/process.c b/src/process.c index 2dab2b58..51bd902f 100644 --- a/src/process.c +++ b/src/process.c @@ -213,9 +213,13 @@ bool detach(void) { #endif } - logmode = use_logfile?LOGMODE_FILE:LOGMODE_SYSLOG; - if(do_detach && !use_syslog) + if(use_logfile) + logmode = LOGMODE_FILE; + else if(use_syslog || do_detach) + logmode = LOGMODE_SYSLOG; + else logmode = LOGMODE_STDERR; + openlogger(identname, logmode); logger(DEBUG_ALWAYS, LOG_NOTICE, "tincd %s (%s %s) starting, debug level %d",