commit c6ee414: [Minor] Forgot in the previous commit

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Jan 17 11:35:07 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-01-17 11:32:44 +0000
URL: https://github.com/rspamd/rspamd/commit/c6ee414bf65009acaa163c2c82aaf38283567b8a (HEAD -> master)

[Minor] Forgot in the previous commit

---
 src/libutil/logger.c | 9 +++++++++
 1 file changed, 9 insertions(+)

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:


More information about the Commits mailing list