summaryrefslogtreecommitdiff
path: root/libc/pwd_grp
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-10-20 21:39:48 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-10-20 21:39:48 +0000
commitf6099118fe833fdc9e1056c9c3a5dcd8bcf1ff17 (patch)
tree40fb28f88fbc3777485cda1f7551ba45af0ae4c1 /libc/pwd_grp
parentec788ca809b14f0ba80abcf268cf8452837b7373 (diff)
Remove duplicate locking defines for IMA compiling.
Diffstat (limited to 'libc/pwd_grp')
-rw-r--r--libc/pwd_grp/pwd_grp.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/libc/pwd_grp/pwd_grp.c b/libc/pwd_grp/pwd_grp.c
index e56b545d6..f1726781a 100644
--- a/libc/pwd_grp/pwd_grp.c
+++ b/libc/pwd_grp/pwd_grp.c
@@ -446,16 +446,19 @@ int getpw(uid_t uid, char *buf)
#endif
/**********************************************************************/
-#ifdef L_getpwent_r
+#if defined(L_getpwent_r) || defined(L_getgrent_r) || defined(L_getspent_r)
#ifdef __UCLIBC_HAS_THREADS__
static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
# define LOCK __pthread_mutex_lock(&mylock)
# define UNLOCK __pthread_mutex_unlock(&mylock);
-#else
+#else
# define LOCK ((void) 0)
# define UNLOCK ((void) 0)
-#endif
+#endif
+#endif
+
+#ifdef L_getpwent_r
static FILE *pwf /*= NULL*/;
@@ -512,15 +515,6 @@ int getpwent_r(struct passwd *__restrict resultbuf,
/**********************************************************************/
#ifdef L_getgrent_r
-#ifdef __UCLIBC_HAS_THREADS__
-static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK __pthread_mutex_lock(&mylock)
-# define UNLOCK __pthread_mutex_unlock(&mylock);
-#else
-# define LOCK ((void) 0)
-# define UNLOCK ((void) 0)
-#endif
-
static FILE *grf /*= NULL*/;
void setgrent(void)
@@ -575,15 +569,6 @@ int getgrent_r(struct group *__restrict resultbuf,
/**********************************************************************/
#ifdef L_getspent_r
-#ifdef __UCLIBC_HAS_THREADS__
-static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK __pthread_mutex_lock(&mylock)
-# define UNLOCK __pthread_mutex_unlock(&mylock);
-#else
-# define LOCK ((void) 0)
-# define UNLOCK ((void) 0)
-#endif
-
static FILE *spf /*= NULL*/;
void setspent(void)