mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-22 18:53:04 +00:00
(bitset_stats_read, bitset_stats_write): Check for close failures.
This commit is contained in:
@@ -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."));
|
||||||
|
|||||||
Reference in New Issue
Block a user