diff options
author | araujo <araujo@FreeBSD.org> | 2015-08-07 02:37:47 +0000 |
---|---|---|
committer | araujo <araujo@FreeBSD.org> | 2015-08-07 02:37:47 +0000 |
commit | 54470b68ed22f9b7704f72861194a153faca2af6 (patch) | |
tree | 906cc8320c92b4bdca6afb43f20fe0f6980cc9e8 /usr.bin | |
parent | 797829fe1ebbe9f393da6977fd1a2f6162c12710 (diff) | |
download | FreeBSD-src-54470b68ed22f9b7704f72861194a153faca2af6.zip FreeBSD-src-54470b68ed22f9b7704f72861194a153faca2af6.tar.gz |
Get closest as possible with style(9). No functional change.
Differential Revision: D3295
Reviewed by: bapt
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ypmatch/ypmatch.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/usr.bin/ypmatch/ypmatch.c b/usr.bin/ypmatch/ypmatch.c index 66fa84a..a57a642 100644 --- a/usr.bin/ypmatch/ypmatch.c +++ b/usr.bin/ypmatch/ypmatch.c @@ -34,20 +34,19 @@ __FBSDID("$FreeBSD$"); #include <sys/param.h> #include <sys/types.h> #include <sys/socket.h> + +#include <ctype.h> +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <ctype.h> -#include <err.h> #include <rpc/rpc.h> #include <rpc/xdr.h> #include <rpcsvc/yp_prot.h> #include <rpcsvc/ypclnt.h> -void usage(void); - static const struct ypalias { char *alias, *name; } ypaliases[] = { @@ -63,11 +62,11 @@ static const struct ypalias { { "ethers", "ethers.byname" }, }; -void +static void usage(void) { - fprintf(stderr, - "usage: ypmatch [-kt] [-d domain] key ... mapname\n" + fprintf(stderr, "%s\n%s\n", + "usage: ypmatch [-kt] [-d domain] key ... mapname", " ypmatch -x\n"); fprintf(stderr, "where\n" @@ -82,8 +81,6 @@ int main(int argc, char *argv[]) { char *domainname, *inkey, *inmap, *outbuf; - extern char *optarg; - extern int optind; int outbuflen, key, notrans, rval; int c, r; u_int i; @@ -114,12 +111,12 @@ main(int argc, char *argv[]) if ((argc-optind) < 2 ) usage(); - if (!domainname) { + if (domainname == NULL) { yp_get_default_domain(&domainname); } inmap = argv[argc-1]; - if (!notrans) { + if (notrans == 0) { for (i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++) if (strcmp(inmap, ypaliases[i].alias) == 0) inmap = ypaliases[i].name; @@ -138,10 +135,9 @@ main(int argc, char *argv[]) printf("%*.*s\n", outbuflen, outbuflen, outbuf); break; case YPERR_YPBIND: - errx(1, "yp_match: not running ypbind"); - exit(1); + errx(1, "not running ypbind"); default: - errx(1, "Can't match key %s in map %s. Reason: %s\n", + errx(1, "can't match key %s in map %s. Reason: %s", inkey, inmap, yperr_string(r)); rval = 1; break; |