From e5f6f4dda3b3dd8b44d9eedeff41eedea84393db Mon Sep 17 00:00:00 2001 From: Markus Uhlin Date: Sun, 8 Mar 2026 00:09:17 +0100 Subject: truncate_file: log close() error --- FICS/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/FICS/utils.c b/FICS/utils.c index 71a2ee5..a04ecb6 100644 --- a/FICS/utils.c +++ b/FICS/utils.c @@ -979,7 +979,10 @@ truncate_file(const char *file, int lines) return -1; } else if ((fp = fdopen(fd, "w")) == NULL) { warn("%s: fdopen", __func__); - close(fd); + + if (close(fd) != 0) + warn("%s: close() error", __func__); + return -1; } -- cgit v1.2.3