diff options
author | Bruno Haible <bruno@clisp.org> | 2020-05-26 17:51:03 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2020-05-27 19:29:22 +0200 |
commit | a599a058a0d1c0d62ae811c9c5a17e6690887d8a (patch) | |
tree | 9254e74f191ce865bce5c90b57fd45d0a6f7199d | |
parent | a2080f6506701d8d9ca5111d628607a6a8013f61 (diff) | |
download | gnulib-a599a058a0d1c0d62ae811c9c5a17e6690887d8a.tar.gz |
bitset: Make more robust in multithreaded applications.
* lib/bitset/stats.c (bitset_stats_read, bitset_stats_write): Pass an
'e' flag to fopen.
* modules/bitset (Depends-on): Add fopen-gnu.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | lib/bitset/stats.c | 4 | ||||
-rw-r--r-- | modules/bitset | 1 |
3 files changed, 10 insertions, 2 deletions
@@ -1,3 +1,10 @@ +2020-05-27 Bruno Haible <bruno@clisp.org> + + bitset: Make more robust in multithreaded applications. + * lib/bitset/stats.c (bitset_stats_read, bitset_stats_write): Pass an + 'e' flag to fopen. + * modules/bitset (Depends-on): Add fopen-gnu. + 2020-05-27 Daiki Ueno <ueno@gnu.org> read-file: add RF_SENSITIVE flag diff --git a/lib/bitset/stats.c b/lib/bitset/stats.c index 10aa5d768d..5bd44c06a4 100644 --- a/lib/bitset/stats.c +++ b/lib/bitset/stats.c @@ -245,7 +245,7 @@ bitset_stats_read (const char *file_name) if (!file_name) file_name = BITSET_STATS_FILE; - FILE *file = fopen (file_name, "r"); + FILE *file = fopen (file_name, "re"); if (file) { if (fread (&bitset_stats_info_data, sizeof (bitset_stats_info_data), @@ -273,7 +273,7 @@ bitset_stats_write (const char *file_name) if (!file_name) file_name = BITSET_STATS_FILE; - FILE *file = fopen (file_name, "w"); + FILE *file = fopen (file_name, "we"); if (file) { if (fwrite (&bitset_stats_info_data, sizeof (bitset_stats_info_data), diff --git a/modules/bitset b/modules/bitset index ec7f34b60a..20c680634b 100644 --- a/modules/bitset +++ b/modules/bitset @@ -19,6 +19,7 @@ lib/bitset/vector.h Depends-on: attribute c99 +fopen-gnu gettext-h obstack xalloc |