summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2008-07-28 16:22:12 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2008-07-28 16:22:12 +0000
commit6b44b2e33bbcd5ee5d51495d1cceebbebf18b8ef (patch)
treea03d5a1fa99fea6cd271a94600199d49d8dc2b41 /usr.sbin
parent5a812da7a4fa1d1d1183f10c01dbd68f96a53601 (diff)
some cleanup; Gleydson Soares
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/ypset/ypset.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/usr.sbin/ypset/ypset.c b/usr.sbin/ypset/ypset.c
index 0b2cb85e55c..3013210b408 100644
--- a/usr.sbin/ypset/ypset.c
+++ b/usr.sbin/ypset/ypset.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypset.c,v 1.17 2007/02/18 23:37:53 jmc Exp $ */
+/* $OpenBSD: ypset.c,v 1.18 2008/07/28 16:22:11 deraadt Exp $ */
/* $NetBSD: ypset.c,v 1.8 1996/05/13 02:46:33 thorpej Exp $ */
/*
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: ypset.c,v 1.17 2007/02/18 23:37:53 jmc Exp $";
+static char rcsid[] = "$OpenBSD: ypset.c,v 1.18 2008/07/28 16:22:11 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -88,7 +88,7 @@ bind_tohost(struct sockaddr_in *sin, char *dom, char *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;
}
@@ -130,11 +130,8 @@ main(int argc, char *argv[])
case 'h':
if (inet_aton(optarg, &sin.sin_addr) == 0) {
hent = gethostbyname(optarg);
- if (hent == NULL) {
- fprintf(stderr, "ypset: host %s unknown\n",
- optarg);
- exit(1);
- }
+ if (hent == NULL)
+ errx(1, "host %s unknown\n", optarg);
bcopy(hent->h_addr, &sin.sin_addr,
sizeof(sin.sin_addr));
}
@@ -143,7 +140,7 @@ main(int argc, char *argv[])
usage();
}
- if (optind + 1 != argc )
+ if (optind + 1 != argc)
usage();
if (bind_tohost(&sin, domainname, argv[optind]))