Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Aug 2015 02:37:48 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r286394 - head/usr.bin/ypmatch
Message-ID:  <201508070237.t772bmQJ065072@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo (ports committer)
Date: Fri Aug  7 02:37:47 2015
New Revision: 286394
URL: https://svnweb.freebsd.org/changeset/base/286394

Log:
  Get closest as possible with style(9). No functional change.
  
  Differential Revision:	D3295
  Reviewed by:		bapt

Modified:
  head/usr.bin/ypmatch/ypmatch.c

Modified: head/usr.bin/ypmatch/ypmatch.c
==============================================================================
--- head/usr.bin/ypmatch/ypmatch.c	Fri Aug  7 02:05:16 2015	(r286393)
+++ head/usr.bin/ypmatch/ypmatch.c	Fri Aug  7 02:37:47 2015	(r286394)
@@ -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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508070237.t772bmQJ065072>