=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ypwhich/ypwhich.c,v retrieving revision 1.12 retrieving revision 1.13 diff -c -r1.12 -r1.13 *** src/usr.bin/ypwhich/ypwhich.c 2002/06/02 06:42:28 1.12 --- src/usr.bin/ypwhich/ypwhich.c 2002/07/19 03:20:17 1.13 *************** *** 1,4 **** ! /* $OpenBSD: ypwhich.c,v 1.12 2002/06/02 06:42:28 deraadt Exp $ */ /* $NetBSD: ypwhich.c,v 1.6 1996/05/13 02:43:48 thorpej Exp $ */ /* --- 1,4 ---- ! /* $OpenBSD: ypwhich.c,v 1.13 2002/07/19 03:20:17 deraadt Exp $ */ /* $NetBSD: ypwhich.c,v 1.6 1996/05/13 02:43:48 thorpej Exp $ */ /* *************** *** 34,40 **** */ #ifndef LINT ! static char rcsid[] = "$Id: ypwhich.c,v 1.12 2002/06/02 06:42:28 deraadt Exp $"; #endif #include --- 34,40 ---- */ #ifndef LINT ! static char rcsid[] = "$Id: ypwhich.c,v 1.13 2002/07/19 03:20:17 deraadt Exp $"; #endif #include *************** *** 73,83 **** }; void ! usage() { ! fprintf(stderr, "Usage:\n"); ! fprintf(stderr, "\typwhich [-d domain] [[-h host] [-t] -m [mname] | host]\n"); ! fprintf(stderr, "\typwhich -x\n"); exit(1); } --- 73,83 ---- }; void ! usage(void) { ! fprintf(stderr, ! "usage: ypwhich [-d domain] [[-h host] [-t] -m [mname] | host]\n"); ! fprintf(stderr, " ypwhich -x\n"); exit(1); } *************** *** 86,101 **** * Like yp_bind except can query a specific host */ int ! bind_host(dom, sin) ! char *dom; ! struct sockaddr_in *sin; { struct hostent *hent = NULL; struct ypbind_resp ypbr; struct timeval tv; CLIENT *client; int sock, r; - struct in_addr ss_addr; sock = RPC_ANYSOCK; tv.tv_sec = 15; --- 86,99 ---- * Like yp_bind except can query a specific host */ int ! bind_host(char *dom, struct sockaddr_in *sin) { struct hostent *hent = NULL; struct ypbind_resp ypbr; + struct in_addr ss_addr; struct timeval tv; CLIENT *client; int sock, r; sock = RPC_ANYSOCK; tv.tv_sec = 15; *************** *** 139,160 **** return 0; } ! int ! main(argc, argv) ! int argc; ! char **argv; { ! char *domain, *master, *map; struct ypmaplist *ypml, *y; - struct hostent *hent; struct sockaddr_in sin; ! int notrans, mode, getmap; ! int c, r, i; ! CLIENT *client; ! char *host = NULL; - map = NULL; getmap = notrans = mode = 0; yp_get_default_domain(&domain); --- 137,153 ---- return 0; } ! int ! main(int argc, char *argv[]) { ! char *domain, *master, *map = NULL, *host = NULL; ! int notrans, mode, getmap, c, r, i; struct ypmaplist *ypml, *y; struct sockaddr_in sin; ! struct hostent *hent; ! CLIENT *client = NULL; getmap = notrans = mode = 0; yp_get_default_domain(&domain); *************** *** 221,241 **** if (argc > 1) usage(); ! if (host != NULL) { client = yp_bind_host(host,YPPROG,YPVERS,0,1); ! } ! if (argv[0]) { map = argv[0]; for (i=0; (!notrans) && i 1) usage(); ! if (host != NULL) client = yp_bind_host(host,YPPROG,YPVERS,0,1); ! if (argv[0]) { map = argv[0]; for (i=0; (!notrans) && i