$NetBSD: patch-ac,v 1.1 2005/11/02 15:08:44 tv Exp $ --- host2ip.c.orig 1999-05-19 15:58:25.000000000 -0400 +++ host2ip.c @@ -1,10 +1,13 @@ #include #include /* struct sockaddr */ #include +#include #include /* gethostbyname() */ #include /* sockaddr_in */ #include /* inet_addr() */ +#if HAVE_RPCSVC_YPCLNT_H #include /* YP */ +#endif #include /* isspace() */ #include "host2ip.h" @@ -39,6 +42,7 @@ struct in_addr host2ip(char *host) } /* As a last resort, try YP. */ else { +#if HAVE_RPCSVC_YPCLNT_H static char *domain = 0; /* YP domain */ char *value; /* key value */ int value_len; /* length of returned value */ @@ -47,9 +51,12 @@ struct in_addr host2ip(char *host) if (yp_match(domain, "hosts.byname", host, strlen(host), &value, &value_len) == 0) { in.s_addr = inet_addr(value); } else { +#endif /* Everything failed */ in.s_addr = INADDR_ANY; +#if HAVE_RPCSVC_YPCLNT_H } +#endif } return in; } /* host2ip */