summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-04-14 23:54:37 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-04-14 23:54:37 +0000
commit4a51ab87682b0f2a4aff3aaabd39980f48a95184 (patch)
tree9569b8acb2c106b70ecb9393774de4e9f877eae6
parentec7ae7fb6bcd12e5641e7096e56e0d4d922e8d6b (diff)
Specifying an invalid number of nfsd's is an error. So error out
rather than try to guess what was intended. ok halex@ tedu@ deraadt@
-rw-r--r--sbin/nfsd/nfsd.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/sbin/nfsd/nfsd.c b/sbin/nfsd/nfsd.c
index 948efa1e9f1..a4b04403dae 100644
--- a/sbin/nfsd/nfsd.c
+++ b/sbin/nfsd/nfsd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfsd.c,v 1.29 2009/10/27 23:59:33 deraadt Exp $ */
+/* $OpenBSD: nfsd.c,v 1.30 2010/04/14 23:54:36 krw Exp $ */
/* $NetBSD: nfsd.c,v 1.19 1996/02/18 23:18:56 mycroft Exp $ */
/*
@@ -117,11 +117,8 @@ main(int argc, char *argv[])
switch (ch) {
case 'n':
nfsdcnt = strtonum(optarg, 1, MAXNFSDCNT, &errstr);
- if (errstr) {
- warnx("nfsd count %s %s; reset to %d",
- optarg, errstr, DEFNFSDCNT);
- nfsdcnt = DEFNFSDCNT;
- }
+ if (errstr)
+ errx(1, "nfsd count is %s: %s", errstr, optarg);
break;
case 'r':
reregister = 1;
@@ -146,11 +143,8 @@ main(int argc, char *argv[])
usage();
if (argc == 1) {
nfsdcnt = strtonum(argv[0], 1, MAXNFSDCNT, &errstr);
- if (errstr) {
- warnx("nfsd count %s %s; reset to %d",
- argv[0], errstr, DEFNFSDCNT);
- nfsdcnt = DEFNFSDCNT;
- }
+ if (errstr)
+ errx(1, "nfsd count is %s: %s", errstr, argv[0]);
}
if (debug == 0) {