From: Matt Signorini Date: Thu, 27 Dec 2012 05:06:56 +0000 (+1100) Subject: Modifications to log.c to ensure that a log file specified in fcron.conf takes preced... X-Git-Tag: ver3_1_1~6^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=81783ce69b47abec94a3e30592e032f35b401310;p=fcron Modifications to log.c to ensure that a log file specified in fcron.conf takes precedence over syslog. --- diff --git a/log.c b/log.c index f27b672..944f7c0 100644 --- a/log.c +++ b/log.c @@ -68,7 +68,7 @@ xopenlog(void) return; // are we using syslog? - if (dosyslog) { + if (dosyslog && (fcronlog == NULL)) { openlog(prog_name, LOG_PID, SYSLOG_FACILITY); } else if (fcronlog != NULL) { logfd = fopen(fcronlog, "a+"); @@ -85,7 +85,7 @@ xcloselog() return; // check whether we need to close syslog, or a file. - if (dosyslog) { + if (dosyslog && (fcronlog == NULL)) { closelog(); } else if (fcronlog != NULL) { fclose(logfd); @@ -126,9 +126,9 @@ log_syslog_str(int priority, char *msg) { xopenlog(); - if (dosyslog) { + if (dosyslog && (logfd == NULL)) { syslog(priority, "%s", msg); - } else if ( logfd != NULL ) { + } else if (logfd != NULL) { fcronlog(priority, msg); }