summaryrefslogtreecommitdiffstats
path: root/src/libutil/logger.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-17 11:32:44 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-01-17 11:32:44 +0000
commitc6ee414bf65009acaa163c2c82aaf38283567b8a (patch)
tree1fa79881909f8c732315b9154c5369ff26c74372 /src/libutil/logger.c
parent45e55eed1fe7594641adfec4eb6ee930543a4275 (diff)
downloadrspamd-c6ee414bf65009acaa163c2c82aaf38283567b8a.tar.gz
rspamd-c6ee414bf65009acaa163c2c82aaf38283567b8a.zip
[Minor] Forgot in the previous commit
Diffstat (limited to 'src/libutil/logger.c')
-rw-r--r--src/libutil/logger.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libutil/logger.c b/src/libutil/logger.c
index 732eabf26..988f27023 100644
--- a/src/libutil/logger.c
+++ b/src/libutil/logger.c
@@ -334,6 +334,15 @@ rspamd_log_open_priv (rspamd_logger_t *rspamd_log, uid_t uid, gid_t gid)
openlog ("rspamd", LOG_NDELAY | LOG_PID,
rspamd_log->log_facility);
rspamd_log->no_lock = TRUE;
+ if (rspamd_log->fd != -1) {
+ /*
+ * Postponed closing (e.g. when we switch from
+ * LOG_FILE to LOG_SYSLOG)
+ */
+ close (rspamd_log->fd);
+ }
+#else
+ return -1;
#endif
break;
case RSPAMD_LOG_FILE: