summaryrefslogtreecommitdiffstats
path: root/usr.bin/ypwhich
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-06-12 13:04:59 +0000
committerpeter <peter@FreeBSD.org>1998-06-12 13:04:59 +0000
commite6d8366d2523eb3b54fe46cb4a44ba507c7415ac (patch)
tree010f6b5760d749cf1d6d4b8b6a6307fda0e0c257 /usr.bin/ypwhich
parent0b9db54b14d20dd5b0d9d814fcf585c1da3ff9d0 (diff)
downloadFreeBSD-src-e6d8366d2523eb3b54fe46cb4a44ba507c7415ac.zip
FreeBSD-src-e6d8366d2523eb3b54fe46cb4a44ba507c7415ac.tar.gz
#include <arpa/inet.h>
Also, use real struct in_addr rather than u_long.
Diffstat (limited to 'usr.bin/ypwhich')
-rw-r--r--usr.bin/ypwhich/ypwhich.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c
index e564627..763875f 100644
--- a/usr.bin/ypwhich/ypwhich.c
+++ b/usr.bin/ypwhich/ypwhich.c
@@ -29,12 +29,14 @@
#ifndef lint
static const char rcsid[] =
- "$Id$";
+ "$Id: ypwhich.c,v 1.9 1997/08/29 11:56:51 charnier Exp $";
#endif /* not lint */
#include <sys/param.h>
#include <sys/types.h>
#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include <ctype.h>
#include <err.h>
#include <netdb.h>
@@ -93,7 +95,7 @@ struct sockaddr_in *sin;
struct timeval tv;
CLIENT *client;
int sock, r;
- u_long ss_addr;
+ struct in_addr ss_addr;
sock = RPC_ANYSOCK;
tv.tv_sec = 15;
@@ -122,7 +124,7 @@ struct sockaddr_in *sin;
}
clnt_destroy(client);
- ss_addr = *(u_long *)ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr;
+ ss_addr = *(struct in_addr *)ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr;
/*printf("%08x\n", ss_addr);*/
hent = gethostbyaddr((char *)&ss_addr, sizeof(ss_addr), AF_INET);
if (hent)
OpenPOWER on IntegriCloud