Explicitly check C_ERR condition to improve readability in clusterSaveConfig (#1505)

It's not obvious to see it at first, modify it to use C_ERR.

Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2025-01-04 10:47:32 +08:00 committed by GitHub
parent b3b4bdcda4
commit 33b824137e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -868,7 +868,7 @@ int clusterSaveConfig(int do_fsync) {
cleanup:
if (fd != -1) close(fd);
if (retval) unlink(tmpfilename);
if (retval == C_ERR) unlink(tmpfilename);
sdsfree(tmpfilename);
sdsfree(ci);
return retval;