aboutsummaryrefslogtreecommitdiff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/locale.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 9c689d2..da1c0ff7 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -34,6 +34,7 @@
#include <locale.h>
#include <search.h>
#include <stdio.h>
+#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -364,7 +365,10 @@ write_locales (void)
/* Ignore non-existing files. */
continue;
- while (! feof (fp))
+ /* No threads present. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+
+ while (! feof_unlocked (fp))
{
/* It is a reasonable approach to use a fix buffer here
because