[uClibc-cvs] CVS update of uClibc/libc/inet (resolv.c)

Erik Andersen andersen at codepoet.org
Sun Aug 15 03:59:37 UTC 2004


    Date: Saturday, August 14, 2004 @ 21:59:37
  Author: andersen
    Path: /var/cvs/uClibc/libc/inet

Modified: resolv.c (1.55 -> 1.56)

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


Index: uClibc/libc/inet/resolv.c
diff -u uClibc/libc/inet/resolv.c:1.55 uClibc/libc/inet/resolv.c:1.56
--- uClibc/libc/inet/resolv.c:1.55	Sat Aug 14 01:23:48 2004
+++ uClibc/libc/inet/resolv.c	Sat Aug 14 21:59:36 2004
@@ -1059,9 +1059,7 @@
 	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 __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 __nameserversXX;
 	char ** __nameserverXX;
 
-	if (__open_nameservers()) {
-		return(-1);
-	}
-
+	__open_nameservers();
 	*result=NULL;
 	if (!name)
 		return EINVAL;
@@ -2011,14 +2007,11 @@
 
 	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 @@
 			return i;
 	}
 
-	if (__open_nameservers()) {
-		return(-1);
-	}
+	__open_nameservers();
 
 #ifdef __UCLIBC_HAS_IPV6__
 	qp=buf;



More information about the uClibc-cvs mailing list