From f6099118fe833fdc9e1056c9c3a5dcd8bcf1ff17 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 20 Oct 2005 21:39:48 +0000 Subject: Remove duplicate locking defines for IMA compiling. --- libc/pwd_grp/pwd_grp.c | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) (limited to 'libc') 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) -- cgit v1.2.3