From 0f2cb9b020b907000a28323fc57a82fdb7d6626d Mon Sep 17 00:00:00 2001 From: des Date: Wed, 6 Feb 2002 13:30:31 +0000 Subject: Apply the following mechanical transformations in preparation for ansification and constification: s{\s+__P\((\(.*?\))\)}{$1}g; s{\(\s+}{\(}g; s{\s+\)}{\)}g; s{\s+,}{,}g; s{(\s+)(for|if|switch|while)\(}{$1$2 \(}g; s{return ([^\(].*?);}{return ($1);}g; s{([\w\)])([!=+/\*-]?=)([\w\(+-])}{$1 $2 $3}g; s{\s+$}{\n};g Also add $FreeBSD$ where needed. MFC after: 1 week --- usr.bin/ypwhich/ypwhich.c | 48 +++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'usr.bin/ypwhich') diff --git a/usr.bin/ypwhich/ypwhich.c b/usr.bin/ypwhich/ypwhich.c index cce0ce6..9137c99 100644 --- a/usr.bin/ypwhich/ypwhich.c +++ b/usr.bin/ypwhich/ypwhich.c @@ -102,25 +102,25 @@ bind_host(char *dom, struct sockaddr_in *lsin) tv.tv_sec = 15; tv.tv_usec = 0; client = clntudp_create(lsin, YPBINDPROG, YPBINDVERS, tv, &sock); - if(client==NULL) { + if (client == NULL) { warnx("can't clntudp_create: %s", yperr_string(YPERR_YPBIND)); - return YPERR_YPBIND; + return (YPERR_YPBIND); } tv.tv_sec = 5; tv.tv_usec = 0; r = clnt_call(client, YPBINDPROC_DOMAIN, xdr_domainname, &dom, xdr_ypbind_resp, &ypbr, tv); - if( r != RPC_SUCCESS) { + if (r != RPC_SUCCESS) { warnx("can't clnt_call: %s", yperr_string(YPERR_YPBIND)); clnt_destroy(client); - return YPERR_YPBIND; + return (YPERR_YPBIND); } else { if (ypbr.ypbind_status != YPBIND_SUCC_VAL) { warnx("can't yp_bind: reason: %s", ypbinderr_string(ypbr.ypbind_resp_u.ypbind_error)); clnt_destroy(client); - return r; + return (r); } } clnt_destroy(client); @@ -132,7 +132,7 @@ bind_host(char *dom, struct sockaddr_in *lsin) printf("%s\n", hent->h_name); else printf("%s\n", inet_ntoa(ss_addr)); - return 0; + return (0); } int @@ -148,10 +148,10 @@ main(int argc, char *argv[]) u_int i; getmap = notrans = mode = 0; - while( (c=getopt(argc, argv, "xd:mt")) != -1) - switch(c) { + while ((c = getopt(argc, argv, "xd:mt")) != -1) + switch (c) { case 'x': - for(i=0; ih_addr_list[0], (char *)&lsin.sin_addr, sizeof lsin.sin_addr); } - if(bind_host(domnam, &lsin)) + if (bind_host(domnam, &lsin)) exit(ERR_NOBINDING); break; default: @@ -201,16 +201,16 @@ main(int argc, char *argv[]) exit(0); } - if( argc-optind > 1) + if (argc-optind > 1) usage(); - if(argv[optind]) { + if (argv[optind]) { map = argv[optind]; - for(i=0; (!notrans) && imap, &master); - switch(r) { + switch (r) { case 0: printf("%s %s\n", ypml->map, master); free(master); -- cgit v1.1