From 803d9242ff6de1177f25b7ce207777bebdb8b621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= Date: Thu, 14 Mar 2019 10:17:48 +0100 Subject: [PATCH] log: journal: fix forgotten syslog reload when flipped from journal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan Pokorný --- lib/ipc_socket.c | 4 ++-- lib/log.c | 1 + lib/log_syslog.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/ipc_socket.c b/lib/ipc_socket.c index 800f595a9..0a13ebf2f 100644 --- a/lib/ipc_socket.c +++ b/lib/ipc_socket.c @@ -108,8 +108,8 @@ qb_ipc_dgram_sock_setup(const char *base_name, sizeof(local_address)); if (use_filesystem_sockets()) { - chmod(local_address.sun_path, 0660); - chown(local_address.sun_path, -1, gid); + (void)chmod(local_address.sun_path, 0660); + (void)chown(local_address.sun_path, -1, gid); } if (res < 0) { goto error_connect; diff --git a/lib/log.c b/lib/log.c index 809c8f85a..d6074b87a 100644 --- a/lib/log.c +++ b/lib/log.c @@ -1103,6 +1103,7 @@ qb_log_ctl2(int32_t t, enum qb_log_conf c, qb_log_ctl2_arg_t arg_not4directuse) #ifdef USE_JOURNAL if (t == QB_LOG_SYSLOG) { conf[t].use_journal = arg_i32; + need_reload = QB_TRUE; } else { rc = -EINVAL; } diff --git a/lib/log_syslog.c b/lib/log_syslog.c index a2ebf01ae..b1b8246e3 100644 --- a/lib/log_syslog.c +++ b/lib/log_syslog.c @@ -97,8 +97,8 @@ _syslog_reload(int32_t target) { struct qb_log_target *t = qb_log_target_get(target); + closelog(); if (!t->use_journal) { - closelog(); openlog(t->name, LOG_PID, t->facility); } }