]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Forgot in the previous commit
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Jan 2020 11:32:44 +0000 (11:32 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Jan 2020 11:32:44 +0000 (11:32 +0000)
src/libutil/logger.c

index 732eabf26956f8d2175583b57845b720c3ef8cf0..988f27023161737815ce012746741959fd1dd5ac 100644 (file)
@@ -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: