Skip to content

Commit

Permalink
Explicitly check C_ERR condition to improve readability in clusterSav…
Browse files Browse the repository at this point in the history
…eConfig (#1505)

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

Signed-off-by: Binbin <[email protected]>
  • Loading branch information
enjoy-binbin authored Jan 4, 2025
1 parent b3b4bdc commit 33b8241
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cluster_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 33b8241

Please sign in to comment.