From 7b2e1ddf315205da1a3743fe1c7b4b24e40f203a Mon Sep 17 00:00:00 2001 From: peter Date: Sun, 26 Oct 2003 05:30:40 +0000 Subject: [PATCH] Fix up warnings. There were some biggies here. There seems to be two different sets of definitions in /usr/include/rpcsvc, mostly compatable, but with different names. Will the real one please stand up? In order to get prototypes for yp_maplist, we had to use the 'other' naming system. --- usr.bin/ypwhich/ypwhich.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c index 1c6f36c26c26..04331916cba6 100644 --- a/usr.bin/ypwhich/ypwhich.c +++ b/usr.bin/ypwhich/ypwhich.c @@ -34,6 +34,9 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include +#include #include #include @@ -47,10 +50,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include -#include -struct dom_binding{}; #define ERR_USAGE 1 /* bad arguments - display 'usage' message */ #define ERR_NOSUCHHOST 2 /* no such host */ @@ -61,7 +60,7 @@ struct dom_binding{}; extern bool_t xdr_domainname(); struct ypalias { - const char *alias, *name; + char *alias, *name; } ypaliases[] = { { "passwd", "passwd.byname" }, { "master.passwd", "master.passwd.byname" }, @@ -109,7 +108,8 @@ bind_host(char *dom, struct sockaddr_in *lsin) tv.tv_sec = 5; tv.tv_usec = 0; r = clnt_call(client, YPBINDPROC_DOMAIN, - xdr_domainname, &dom, xdr_ypbind_resp, &ypbr, tv); + (xdrproc_t)xdr_domainname, &dom, + (xdrproc_t)xdr_ypbind_resp, &ypbr, tv); if (r != RPC_SUCCESS) { warnx("can't clnt_call: %s", yperr_string(YPERR_YPBIND)); clnt_destroy(client); @@ -117,14 +117,14 @@ bind_host(char *dom, struct sockaddr_in *lsin) } else { if (ypbr.ypbind_status != YPBIND_SUCC_VAL) { warnx("can't yp_bind: reason: %s", - ypbinderr_string(ypbr.ypbind_resp_u.ypbind_error)); + ypbinderr_string(ypbr.ypbind_respbody.ypbind_error)); clnt_destroy(client); return (r); } } clnt_destroy(client); - ss_addr = *(struct in_addr *)ypbr.ypbind_resp_u.ypbind_bindinfo.ypbind_binding_addr; + ss_addr = ypbr.ypbind_respbody.ypbind_bindinfo.ypbind_binding_addr; /*printf("%08x\n", ss_addr);*/ hent = gethostbyaddr((char *)&ss_addr, sizeof(ss_addr), AF_INET); if (hent) @@ -138,7 +138,7 @@ int main(int argc, char *argv[]) { char *domnam = NULL, *master; - const char *map = NULL; + char *map = NULL; struct ypmaplist *ypml, *y; struct hostent *hent; struct sockaddr_in lsin; @@ -229,18 +229,18 @@ main(int argc, char *argv[]) case 0: for (y = ypml; y;) { ypml = y; - r = yp_master(domnam, ypml->map, &master); + r = yp_master(domnam, ypml->ypml_name, &master); switch (r) { case 0: - printf("%s %s\n", ypml->map, master); + printf("%s %s\n", ypml->ypml_name, master); free(master); break; default: warnx("can't find the master of %s: reason: %s", - ypml->map, yperr_string(r)); + ypml->ypml_name, yperr_string(r)); break; } - y = ypml->next; + y = ypml->ypml_next; free(ypml); } break;