zero errno
authorKevin Dunlap <kjd@ucbvax.Berkeley.EDU>
Fri, 31 Oct 1986 06:07:25 +0000 (22:07 -0800)
committerKevin Dunlap <kjd@ucbvax.Berkeley.EDU>
Fri, 31 Oct 1986 06:07:25 +0000 (22:07 -0800)
SCCS-vsn: lib/libc/net/gethostnamadr.c 6.14

usr/src/lib/libc/net/gethostnamadr.c

index 015e700..482b0cd 100644 (file)
@@ -5,7 +5,7 @@
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
  */
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char sccsid[] = "@(#)gethostnamadr.c    6.13 (Berkeley) %G%";
+static char sccsid[] = "@(#)gethostnamadr.c    6.14 (Berkeley) %G%";
 #endif LIBC_SCCS and not lint
 
 #include <sys/types.h>
 #endif LIBC_SCCS and not lint
 
 #include <sys/types.h>
@@ -232,6 +232,7 @@ gethostbyname(name)
        register struct hostent *hp;
        extern struct hostent *_gethtbyname();
 
        register struct hostent *hp;
        extern struct hostent *_gethtbyname();
 
+       errno = 0;
        n = res_mkquery(QUERY, name, C_IN, T_A, (char *)NULL, 0, NULL,
                (char *)&buf, sizeof(buf));
        if (n < 0) {
        n = res_mkquery(QUERY, name, C_IN, T_A, (char *)NULL, 0, NULL,
                (char *)&buf, sizeof(buf));
        if (n < 0) {