e01411cca0
Install documentation (only available in HTML). Bump PKGREVISION.
39 lines
1.1 KiB
Text
39 lines
1.1 KiB
Text
$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 <sys/types.h>
|
|
#include <sys/socket.h> /* struct sockaddr */
|
|
#include <stdlib.h>
|
|
+#include <string.h>
|
|
#include <netdb.h> /* gethostbyname() */
|
|
#include <netinet/in.h> /* sockaddr_in */
|
|
#include <arpa/inet.h> /* inet_addr() */
|
|
+#if HAVE_RPCSVC_YPCLNT_H
|
|
#include <rpcsvc/ypclnt.h> /* YP */
|
|
+#endif
|
|
#include <ctype.h> /* 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 */
|