Avoid close before logging to preserve errno (#8703)

This commit is contained in:
Wen Hui 2021-04-15 14:11:40 -04:00 committed by GitHub
parent 47c54769ce
commit 256ae69e16

View File

@ -2320,8 +2320,8 @@ void sentinelFlushConfig(void) {
return; return;
werr: werr:
if (fd != -1) close(fd);
serverLog(LL_WARNING,"WARNING: Sentinel was not able to save the new configuration on disk!!!: %s", strerror(errno)); 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 ======================= */ /* ====================== hiredis connection handling ======================= */