diff options
| author | Markus Uhlin <markus@nifty-networks.net> | 2026-03-09 20:05:47 +0100 |
|---|---|---|
| committer | Markus Uhlin <markus@nifty-networks.net> | 2026-03-09 20:05:47 +0100 |
| commit | bdda485b2ace42ccdf628f4366ea3b6a9ef1e801 (patch) | |
| tree | 64bb94364f012d96c898c80e283c98ae130b2f80 /FICS/ratings.c | |
| parent | 0eeef609629d1de8f9571d891c973eed666740a6 (diff) | |
UpdateRank: log close file errors
Diffstat (limited to 'FICS/ratings.c')
| -rw-r--r-- | FICS/ratings.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/FICS/ratings.c b/FICS/ratings.c index b478e80..6d71892 100644 --- a/FICS/ratings.c +++ b/FICS/ratings.c @@ -1540,12 +1540,17 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName) if ((fd = open(TmpRankFile, g_open_flags[OPFL_WRITE], g_open_modes)) < 0) { warn("%s: open", __func__); - fclose(fp); + + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); return; } else if ((fptemp = fdopen(fd, "w")) == NULL) { warn("%s: unable to open rank file for updating", __func__); - fclose(fp); - close(fd); + + if (fclose(fp) != 0) + warn("%s: error: fclose", __func__); + if (close(fd) != 0) + warn("%s: error: close", __func__); return; } @@ -1586,8 +1591,9 @@ UpdateRank(int type, char *addName, statistics *sNew, char *delName) comp); } - fclose(fptemp); - fclose(fp); + if (fclose(fptemp) != 0 || + fclose(fp) != 0) + warn("%s: error: fclose", __func__); // XXX #define NASH_CODE 0 |
