summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypset
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-02-06 13:30:31 +0000
committerdes <des@FreeBSD.org>2002-02-06 13:30:31 +0000
commit0f2cb9b020b907000a28323fc57a82fdb7d6626d (patch)
treed44f2702502c982570c85130c91c845a83ea8052 /usr.sbin/ypset
parent0e1bb965cc26648289a6a22baf0ad5ef4891edb4 (diff)
downloadFreeBSD-src-0f2cb9b020b907000a28323fc57a82fdb7d6626d.zip
FreeBSD-src-0f2cb9b020b907000a28323fc57a82fdb7d6626d.tar.gz
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
Diffstat (limited to 'usr.sbin/ypset')
-rw-r--r--usr.sbin/ypset/ypset.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c
index c7a3e04..5b3e7cb 100644
--- a/usr.sbin/ypset/ypset.c
+++ b/usr.sbin/ypset/ypset.c
@@ -69,17 +69,17 @@ char *dom, *server;
int r;
unsigned long server_addr;
- if( (port=htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0)
+ if ((port = htons(getrpcport(server, YPPROG, YPPROC_NULL, IPPROTO_UDP))) == 0)
errx(1, "%s not running ypserv", server);
bzero(&ypsd, sizeof ypsd);
- if( (hp = gethostbyname (server)) != NULL ) {
+ if ((hp = gethostbyname (server)) != NULL) {
/* is this the most compatible way?? */
bcopy (hp->h_addr_list[0],
(u_long *)&ypsd.ypsetdom_binding.ypbind_binding_addr,
sizeof (unsigned long));
- } else if( (long)(server_addr = inet_addr (server)) == -1) {
+ } else if ((long)(server_addr = inet_addr (server)) == -1) {
errx(1, "can't find address for %s", server);
} else
bcopy (&server_addr,
@@ -95,21 +95,21 @@ char *dom, *server;
tv.tv_usec = 0;
sock = RPC_ANYSOCK;
client = clntudp_create(sin, YPBINDPROG, YPBINDVERS, tv, &sock);
- if (client==NULL) {
+ if (client == NULL) {
warnx("can't yp_bind, reason: %s", yperr_string(YPERR_YPBIND));
- return YPERR_YPBIND;
+ return (YPERR_YPBIND);
}
client->cl_auth = authunix_create_default();
r = clnt_call(client, YPBINDPROC_SETDOM,
xdr_ypbind_setdom, &ypsd, xdr_void, NULL, tv);
- if(r) {
+ if (r) {
warnx("sorry, cannot ypset for domain %s on host", dom);
clnt_destroy(client);
- return YPERR_YPBIND;
+ return (YPERR_YPBIND);
}
clnt_destroy(client);
- return 0;
+ return (0);
}
int
@@ -127,15 +127,15 @@ char **argv;
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK);
- while( (c=getopt(argc, argv, "h:d:")) != -1)
- switch(c) {
+ while ((c = getopt(argc, argv, "h:d:")) != -1)
+ switch (c) {
case 'd':
domainname = optarg;
break;
case 'h':
- if( (sin.sin_addr.s_addr=inet_addr(optarg)) == -1) {
+ if ((sin.sin_addr.s_addr = inet_addr(optarg)) == -1) {
hent = gethostbyname(optarg);
- if(hent==NULL)
+ if (hent == NULL)
errx(1, "host %s unknown", optarg);
bcopy(&hent->h_addr_list[0], &sin.sin_addr,
sizeof sin.sin_addr);
@@ -145,7 +145,7 @@ char **argv;
usage();
}
- if(optind + 1 != argc )
+ if (optind + 1 != argc)
usage();
if (bind_tohost(&sin, domainname, argv[optind]))
OpenPOWER on IntegriCloud