summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-08-15 03:59:36 +0000
committerEric Andersen <andersen@codepoet.org>2004-08-15 03:59:36 +0000
commit704b94504098993b854e945a0ab880ccbde2124f (patch)
treec02b2636bd715590f54bad615437f734c492118e
parent1fba51dd347e5d2d8f97d7e9f865f9edd310c328 (diff)
Do not fail all lookups when /etc/resolv.conf is missing, as i.e.
checking on 127.0.0.1 is still valid w/o resolv.conf -Erik
-rw-r--r--libc/inet/resolv.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/libc/inet/resolv.c b/libc/inet/resolv.c
index 005089e64..10ae457a2 100644
--- a/libc/inet/resolv.c
+++ b/libc/inet/resolv.c
@@ -1059,9 +1059,7 @@ int res_init(void)
struct __res_state *rp = &(_res);
__close_nameservers();
- if (__open_nameservers()) {
- return(-1);
- }
+ __open_nameservers();
rp->retrans = RES_TIMEOUT;
rp->retry = 4;
rp->options = RES_INIT;
@@ -1125,7 +1123,8 @@ int res_query(const char *dname, int class, int type,
int __nameserversXX;
char ** __nameserverXX;
- if (__open_nameservers() || !dname || class != 1 /* CLASS_IN */) {
+ __open_nameservers();
+ if (!dname || class != 1 /* CLASS_IN */) {
h_errno = NO_RECOVERY;
return(-1);
}
@@ -1857,10 +1856,7 @@ int gethostbyname_r(const char * name,
int __nameserversXX;
char ** __nameserverXX;
- if (__open_nameservers()) {
- return(-1);
- }
-
+ __open_nameservers();
*result=NULL;
if (!name)
return EINVAL;
@@ -2011,14 +2007,11 @@ int gethostbyname2_r(const char *name, int family,
if (family == AF_INET)
return gethostbyname_r(name, result_buf, buf, buflen, result, h_errnop);
-
+
if (family != AF_INET6)
return EINVAL;
-
- if (__open_nameservers()) {
- return(-1);
- }
+ __open_nameservers();
*result=NULL;
if (!name)
return EINVAL;
@@ -2185,9 +2178,7 @@ int gethostbyaddr_r (const void *addr, socklen_t len, int type,
return i;
}
- if (__open_nameservers()) {
- return(-1);
- }
+ __open_nameservers();
#ifdef __UCLIBC_HAS_IPV6__
qp=buf;