From 256ae69e16a6c1bcea8771f209ce38abb604d206 Mon Sep 17 00:00:00 2001 From: Wen Hui Date: Thu, 15 Apr 2021 14:11:40 -0400 Subject: [PATCH] Avoid close before logging to preserve errno (#8703) --- src/sentinel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sentinel.c b/src/sentinel.c index f581fd8de..a56cd8b15 100644 --- a/src/sentinel.c +++ b/src/sentinel.c @@ -2320,8 +2320,8 @@ void sentinelFlushConfig(void) { return; werr: - if (fd != -1) close(fd); serverLog(LL_WARNING,"WARNING: Sentinel was not able to save the new configuration on disk!!!: %s", strerror(errno)); + if (fd != -1) close(fd); } /* ====================== hiredis connection handling ======================= */