summaryrefslogtreecommitdiff
path: root/libc/pwd_grp/initgroups.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/pwd_grp/initgroups.c')
-rw-r--r--libc/pwd_grp/initgroups.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/pwd_grp/initgroups.c b/libc/pwd_grp/initgroups.c
index 1596298e8..84ead9c55 100644
--- a/libc/pwd_grp/initgroups.c
+++ b/libc/pwd_grp/initgroups.c
@@ -27,13 +27,13 @@
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
-static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK pthread_mutex_lock(&mylock)
-# define UNLOCK pthread_mutex_unlock(&mylock);
-#else
+extern pthread_mutex_t __getgrent_lock;
+# define LOCK pthread_mutex_lock(&__getgrent_lock)
+# define UNLOCK pthread_mutex_unlock(&__getgrent_lock);
+#else
# define LOCK
# define UNLOCK
-#endif
+#endif
static char *line_buff = NULL;
static char **members = NULL;