aboutsummaryrefslogtreecommitdiff
path: root/nss/nsswitch.c
diff options
context:
space:
mode:
Diffstat (limited to 'nss/nsswitch.c')
-rw-r--r--nss/nsswitch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/nss/nsswitch.c b/nss/nsswitch.c
index f6d3988675..7799281695 100644
--- a/nss/nsswitch.c
+++ b/nss/nsswitch.c
@@ -24,6 +24,7 @@
#include <bits/libc-lock.h>
#include <search.h>
#include <stdio.h>
+#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
@@ -427,6 +428,9 @@ nss_parse_file (const char *fname)
if (fp == NULL)
return NULL;
+ /* No threads use this stream. */
+ __fsetlocking (fp, FSETLOCKING_BYCALLER);
+
result = (name_database *) malloc (sizeof (name_database));
if (result == NULL)
return NULL;