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 7d749d810b
commit 374401d786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 ======================= */