summaryrefslogtreecommitdiff
path: root/sysdep/unix/log.c
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-04-08 12:09:31 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-04-08 12:28:33 +0200
commit7a7ac656829223713f9e6bcef63d2b5a5efce7d2 (patch)
tree153afd214a815124b37fcd88c66134d716a390cf /sysdep/unix/log.c
parent4bdf1881dc6230b742d7efcaad8eeac4ed25f445 (diff)
parent06edbb67ed807811654e7fd8f0f9b83766430216 (diff)
Merge branch 'master' into int-new-channels
Diffstat (limited to 'sysdep/unix/log.c')
-rw-r--r--sysdep/unix/log.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdep/unix/log.c b/sysdep/unix/log.c
index 7cb26360..b90bbbd2 100644
--- a/sysdep/unix/log.c
+++ b/sysdep/unix/log.c
@@ -284,17 +284,18 @@ log_switch(int debug, list *l, char *new_syslog_name)
current_log_list = l;
#ifdef HAVE_SYSLOG
- if (current_syslog_name && new_syslog_name &&
- !strcmp(current_syslog_name, new_syslog_name))
+ char *old_syslog_name = current_syslog_name;
+ current_syslog_name = new_syslog_name;
+
+ if (old_syslog_name && new_syslog_name &&
+ !strcmp(old_syslog_name, new_syslog_name))
return;
- if (current_syslog_name)
+ if (old_syslog_name)
closelog();
if (new_syslog_name)
openlog(new_syslog_name, LOG_CONS | LOG_NDELAY, LOG_DAEMON);
-
- current_syslog_name = new_syslog_name;
#endif
}