From 81783ce69b47abec94a3e30592e032f35b401310 Mon Sep 17 00:00:00 2001 From: Matt Signorini Date: Thu, 27 Dec 2012 16:06:56 +1100 Subject: [PATCH] Modifications to log.c to ensure that a log file specified in fcron.conf takes precedence over syslog. --- log.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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); } -- 2.50.1