Fix the case where we detach and use --logfile.
authorGuus Sliepen <guus@tinc-vpn.org>
Sat, 14 Mar 2015 12:02:06 +0000 (12:02 +0000)
committerGuus Sliepen <guus@tinc-vpn.org>
Sat, 14 Mar 2015 12:02:06 +0000 (12:02 +0000)
src/process.c

index 2dab2b5..51bd902 100644 (file)
@@ -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",