#ifdef __USE_MISC
/* Convert Internet host address from numbers-and-dots notation in CP
into binary data and store the result in the structure INP. */
-extern in_addr_t inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
+extern int inet_aton (__const char *__cp, struct in_addr *__inp) __THROW;
/* Format a network number NET into presentation format and place result
in buffer starting at BUF with length of LEN bytes. */
#ifdef L_dnslookup
#ifdef __UCLIBC_HAS_THREADS__
-static pthread_mutex_t mylock = PTHREAD_MUTEX_INITIALIZER;
-# define LOCK __pthread_mutex_lock(&mylock)
-# define UNLOCK __pthread_mutex_unlock(&mylock);
+static pthread_mutex_t dns_mylock = PTHREAD_MUTEX_INITIALIZER;
+# define DNS_LOCK __pthread_mutex_lock(&dns_mylock)
+# define DNS_UNLOCK __pthread_mutex_unlock(&dns_mylock);
#else
-# define LOCK
-# define UNLOCK
+# define DNS_LOCK
+# define DNS_UNLOCK
#endif
/* Just for the record, having to lock __dns_lookup() just for these two globals
DPRINTF("Looking up type %d answer for '%s'\n", type, name);
/* Mess with globals while under lock */
- LOCK;
+ DNS_LOCK;
local_ns = ns % nscount;
local_id = id;
- UNLOCK;
+ DNS_UNLOCK;
while (retries < MAX_RETRIES) {
if (fd != -1)
free(lookup);
/* Mess with globals while under lock */
- LOCK;
+ DNS_LOCK;
ns = local_ns;
id = local_id;
- UNLOCK;
+ DNS_UNLOCK;
return (len); /* success! */
h_errno = NETDB_INTERNAL;
/* Mess with globals while under lock */
if (local_ns != -1) {
- LOCK;
+ DNS_LOCK;
ns = local_ns;
id = local_id;
- UNLOCK;
+ DNS_UNLOCK;
}
return -1;
}