aboutsummaryrefslogtreecommitdiffstats
path: root/FICS/command.c
diff options
context:
space:
mode:
authorMarkus Uhlin <markus@nifty-networks.net>2026-04-25 17:12:32 +0200
committerMarkus Uhlin <markus@nifty-networks.net>2026-04-25 17:12:32 +0200
commit8ccb7c66a1d13e62df57dfd70b0836eece92e5b7 (patch)
tree0879610c4c427c200021dc9aa9583d1e7e30a234 /FICS/command.c
parent2c2257d422333015e0bb886a11cd6e81e29ad9ca (diff)
Log fclose() errors
Diffstat (limited to 'FICS/command.c')
-rw-r--r--FICS/command.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/FICS/command.c b/FICS/command.c
index 63a08f3..78ebfe8 100644
--- a/FICS/command.c
+++ b/FICS/command.c
@@ -784,7 +784,10 @@ check_news(int p, int admin)
if (num_anews == -1) {
num_anews = count_lines(fp);
- fclose(fp);
+
+ if (fclose(fp) != 0)
+ warn("%s: error: fclose", __func__);
+
if ((fp = fopen(filename, "r")) == NULL) {
warn("%s: can't find admin news index (%s)",
__func__, filename);
@@ -807,7 +810,8 @@ check_news(int p, int admin)
if ((crtime - lc) < 0) {
pprintf(p, "There are no new admin news items since "
"your last login.\n\n");
- fclose(fp);
+ if (fclose(fp) != 0)
+ warn("%s: error: fclose", __func__);
return;
} else {
pprintf(p, "Index of new admin news items:\n");
@@ -834,7 +838,10 @@ check_news(int p, int admin)
if (num_news == -1) {
num_news = count_lines(fp);
- fclose(fp);
+
+ if (fclose(fp) != 0)
+ warn("%s: error: fclose", __func__);
+
if ((fp = fopen(filename, "r")) == NULL) {
warn("%s: can't find news index (%s)", __func__,
filename);
@@ -857,7 +864,8 @@ check_news(int p, int admin)
if ((crtime - lc) < 0) {
pprintf(p, "There are no new news items since your "
"last login (%s).\n", strltime(&lc));
- fclose(fp);
+ if (fclose(fp) != 0)
+ warn("%s: error: fclose", __func__);
return;
} else {
pprintf(p, "Index of new news items:\n");
@@ -874,7 +882,8 @@ check_news(int p, int admin)
}
}
- fclose(fp);
+ if (fclose(fp) != 0)
+ warn("%s: error: fclose", __func__);
}
PRIVATE int