(bitset_stats_read, bitset_stats_write): Check for close failures.

This commit is contained in:
Paul Eggert
2002-10-30 06:17:52 +00:00
parent 782a05f9de
commit 11a712626c

View File

@@ -261,7 +261,8 @@ bitset_stats_read (const char *filename)
else else
fprintf (stderr, _("Bad stats file size.\n")); fprintf (stderr, _("Bad stats file size.\n"));
} }
fclose (file); if (fclose (file) != 0)
perror (_("Could not read stats file."));
} }
bitset_stats_info_data.runs++; bitset_stats_info_data.runs++;
} }
@@ -285,7 +286,8 @@ bitset_stats_write (const char *filename)
if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data), if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data),
1, file) != 1) 1, file) != 1)
perror (_("Could not write stats file.")); perror (_("Could not write stats file."));
fclose (file); if (fclose (file) != 0)
perror (_("Could not write stats file."));
} }
else else
perror (_("Could not open stats file for writing.")); perror (_("Could not open stats file for writing."));