=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ypwhich/ypwhich.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/ypwhich/ypwhich.c 1998/01/18 20:13:08 1.9 +++ src/usr.bin/ypwhich/ypwhich.c 1999/03/19 22:21:27 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: ypwhich.c,v 1.9 1998/01/18 20:13:08 maja Exp $ */ +/* $OpenBSD: ypwhich.c,v 1.10 1999/03/19 22:21:27 deraadt Exp $ */ /* $NetBSD: ypwhich.c,v 1.6 1996/05/13 02:43:48 thorpej Exp $ */ /* @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: ypwhich.c,v 1.9 1998/01/18 20:13:08 maja Exp $"; +static char rcsid[] = "$Id: ypwhich.c,v 1.10 1999/03/19 22:21:27 deraadt Exp $"; #endif #include @@ -57,8 +57,6 @@ #include #include -#include "yplib_host.h" - struct ypalias { char *alias, *name; } ypaliases[] = { @@ -76,7 +74,7 @@ usage() { fprintf(stderr, "Usage:\n"); - fprintf(stderr, "\typwhich [-d domain] [[-h host] [-t] -m [mname] | host]\n"); + fprintf(stderr, "\typwhich [-d domain] [[-t] -m [mname] | host]\n"); fprintf(stderr, "\typwhich -x\n"); exit(1); } @@ -151,8 +149,6 @@ struct sockaddr_in sin; int notrans, mode, getmap; int c, r, i; - CLIENT *client; - char *host = NULL; map = NULL; getmap = notrans = mode = 0; @@ -161,16 +157,13 @@ if (domain == NULL) errx(1, "YP domain name not set"); - while ((c = getopt(argc, argv, "xd:h:mt")) != -1) + while ((c = getopt(argc, argv, "xd:mt")) != -1) switch(c) { case 'x': for (i=0; i 1) usage(); - if (host == NULL) { - client = yp_bind_local(YPPROG,YPVERS); - } else { - client = yp_bind_host(host,YPPROG,YPVERS,0,1); - } - if (argv[0]) { map = argv[0]; for (i=0; (!notrans) && imap, &master); + r = yp_master(domain, ypml->map, &master); switch(r) { case 0: printf("%s %s\n", ypml->map, master);