summaryrefslogtreecommitdiffstats
path: root/libc/inet/resolv.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2005-10-30 01:14:23 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2005-10-30 01:14:23 +0000
commit6e46869a9c0c9f5e31378247e5835cd0b3301c96 (patch)
treedad4ede474ab46f074fd8381965d160f6a2ac92c /libc/inet/resolv.c
parentca798b3b1e0937336dc382b6f3fe7453a219fd2f (diff)
downloaduClibc-alpine-6e46869a9c0c9f5e31378247e5835cd0b3301c96.tar.bz2
uClibc-alpine-6e46869a9c0c9f5e31378247e5835cd0b3301c96.tar.xz
Merge from trunk.
Diffstat (limited to 'libc/inet/resolv.c')
-rw-r--r--libc/inet/resolv.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 0c73fcab3..eab86c0e8 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -647,7 +647,7 @@ int __form_query(int id, const char *name, int type, unsigned char *packet,
}
#endif
-#ifdef L_dnslookup
+#if defined(L_dnslookup) || defined(L_gethostent)
#ifdef __UCLIBC_HAS_THREADS__
static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
@@ -657,6 +657,9 @@ static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
# define LOCK
# define UNLOCK
#endif
+#endif
+
+#ifdef L_dnslookup
/* Just for the record, having to lock __dns_lookup() just for these two globals
* is pretty lame. I think these two variables can probably be de-global-ized,
@@ -1587,15 +1590,6 @@ int __read_etc_hosts_r(FILE * fp, const char * name, int type,
#ifdef L_gethostent
-#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
-# define UNLOCK
-#endif
-
static int __stay_open;
static FILE * __gethostent_fp;