aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/gamedb.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-03-22 08:37:03 +0100
committerMarkus Uhlin <markus@nifty-networks.net>2026-03-22 08:37:03 +0100
commitd1a26e8bd64d8d9c182075f124bb32afa8443cde (patch)
tree444ae1392da21a45b925ed8075a5764dcca78997 /FICS/gamedb.c
parent69c70af9d1e156c64121f5dcb40c38b1f950c3e7 (diff)
Log close() errors
Diffstat (limited to 'FICS/gamedb.c')
-rw-r--r--FICS/gamedb.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/FICS/gamedb.c b/FICS/gamedb.c
index 467b65a..409e86d 100644
--- a/FICS/gamedb.c
+++ b/FICS/gamedb.c
@@ -1608,7 +1608,8 @@ game_save(int g)
(void) fprintf(stderr, "FICS: "
"Problem opening file %s for write\n",
fname);
- close(fd);
+ if (close(fd) != 0)
+ warn("%s: error closing file descriptor", __func__);
return -1;
}
@@ -1874,7 +1875,8 @@ write_g_out(int g, char *file, int maxlines, int isDraw, char *EndSymbol,
warn("%s: open: %s", __func__, file);
return;
} else if ((fp = fdopen(fd, "a")) == NULL) {
- close(fd);
+ if (close(fd) != 0)
+ warn("%s: error closing file descriptor", __func__);
return;
}
@@ -2014,7 +2016,8 @@ addjournalitem(int p, char count2, char *WhiteName2, int WhiteRating2,
fname);
pprintf(p, "Couldn't update journal! Report this to an admin."
"\n");
- close(fd);
+ if (close(fd) != 0)
+ warn("%s: error closing file descriptor", __func__);
return;
}
@@ -2274,7 +2277,8 @@ game_write_complete(int g, int isDraw, char *EndSymbol)
fname);
}
- close(fd);
+ if (close(fd) != 0)
+ warn("%s: error closing file descriptor", __func__);
}
msnprintf(fname, sizeof fname, "%s/player_data/%c/%s.%s",