From: Paul Eggert Date: Wed, 30 Oct 2002 06:17:52 +0000 (+0000) Subject: (bitset_stats_read, bitset_stats_write): Check for close failures. X-Git-Tag: BISON-1_875~376 X-Git-Url: https://git.saurik.com/bison.git/commitdiff_plain/11a712626cb888dd6a9ab223c59864429fc5ad69?ds=inline (bitset_stats_read, bitset_stats_write): Check for close failures. --- diff --git a/lib/bitset_stats.c b/lib/bitset_stats.c index b14fbc3c..c947abdf 100644 --- a/lib/bitset_stats.c +++ b/lib/bitset_stats.c @@ -261,7 +261,8 @@ bitset_stats_read (const char *filename) else fprintf (stderr, _("Bad stats file size.\n")); } - fclose (file); + if (fclose (file) != 0) + perror (_("Could not read stats file.")); } 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), 1, file) != 1) perror (_("Could not write stats file.")); - fclose (file); + if (fclose (file) != 0) + perror (_("Could not write stats file.")); } else perror (_("Could not open stats file for writing."));