static char rcsid[] = "$Id$";
#endif /* LIBC_SCCS and not lint */
+#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <errno.h>
#include <string.h>
+#ifndef h_errno
extern int h_errno;
+#endif
-#if defined(mips) && defined(SYSTYPE_BSD43)
+#if defined(mips) && defined(SYSTYPE_BSD43) && !defined(errno)
extern int errno;
#endif
cp = answer->buf + HFIXEDSZ;
if (!qdcount) {
if (hp->aa)
- h_errno = HOST_NOT_FOUND;
+ __set_h_errno (HOST_NOT_FOUND);
else
- h_errno = TRY_AGAIN;
+ __set_h_errno (TRY_AGAIN);
return (NULL);
}
while (qdcount-- > 0)
haveanswer = 0;
while (--ancount >= 0 && cp < eom) {
n = dn_expand(answer->buf, eom, cp, bp, buflen);
- if ((n < 0) || !dn_isvalid(bp))
+ if ((n < 0) || !res_dnok(bp))
break;
cp += n;
ans[0] = '\0';
net_entry.n_aliases++;
return (&net_entry);
}
- h_errno = TRY_AGAIN;
+ __set_h_errno (TRY_AGAIN);
return (NULL);
}
int nn, anslen;
querybuf buf;
char qbuf[MAXDNAME];
- u_int32_t net2;
+ u_int32_t net2; /* Changed from unsigned long --roland */
struct netent *net_entry;
if (net_type != AF_INET)
struct netent *net_entry;
if ((_res.options & RES_INIT) == 0 && res_init() == -1) {
- h_errno = NETDB_INTERNAL;
+ __set_h_errno (NETDB_INTERNAL);
return (NULL);
}
strcpy(&qbuf[0], net);