Commit Diff


commit - 8d9ddcf5a81d707cab8bc30ac42291420772f8b7
commit + e5f6f4dda3b3dd8b44d9eedeff41eedea84393db
blob - 71a2ee53c3969d695180e386de218dff6a167b3e
blob + a04ecb670acdc9759b49bcdb1f8247ffed0373bf
--- FICS/utils.c
+++ 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;
 		}