summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2005-10-20 19:26:53 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2005-10-20 19:26:53 +0000
commit789db36adee475a7b5500beca72fea274360a2bd (patch)
treeb25c9325b3e181abe7ffae71ff873a05ea4494ff
parent113d55143e81bc8f69b6995284f86d49efc4cfa1 (diff)
Change in_addr_t inet_aton to int, glibc has it as int and uClibc uses it in addr.c also as int. Rename mylock/LOCK/UNLOCK in resolv.c to allow IMA compiling
-rw-r--r--include/arpa/inet.h2
-rw-r--r--libc/inet/resolv.c22
2 files changed, 12 insertions, 12 deletions
diff --git a/include/arpa/inet.h b/include/arpa/inet.h
index 30af9757d..fe3373b88 100644
--- a/include/arpa/inet.h
+++ b/include/arpa/inet.h
@@ -71,7 +71,7 @@ extern __const char *inet_ntop (int __af, __const void *__restrict __cp,
#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. */
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 27b60efea..389263175 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -650,12 +650,12 @@ int __form_query(int id, const char *name, int type, unsigned char *packet,
#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
@@ -693,10 +693,10 @@ int __dns_lookup(const char *name, int type, int nscount, char **nsip,
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)
@@ -900,10 +900,10 @@ int __dns_lookup(const char *name, int type, int nscount, char **nsip,
free(lookup);
/* Mess with globals while under lock */
- LOCK;
+ DNS_LOCK;
ns = local_ns;
id = local_id;
- UNLOCK;
+ DNS_UNLOCK;
return (len); /* success! */
@@ -951,10 +951,10 @@ fail:
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;
}