aboutsummaryrefslogtreecommitdiffstats
path: root/sbin/nfsiod/nfsiod.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2009-12-26 08:36:02 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2009-12-26 08:36:02 +0000
commit48660452c1bbbc5d7a41a3625df502b71557ca3a (patch)
tree7d197ce34ce48fcbf0e06f9820a8f2bd19aff79c /sbin/nfsiod/nfsiod.c
parente8406463e86e99690b8814381f2474b185b49322 (diff)
downloadsrc-48660452c1bbbc5d7a41a3625df502b71557ca3a.tar.gz
src-48660452c1bbbc5d7a41a3625df502b71557ca3a.zip
- Display current settings when run without options.
- Revise a manpage to NOT sound confusing. [1] In collaboration with: sat [1]
Notes
Notes: svn path=/head/; revision=201015
Diffstat (limited to 'sbin/nfsiod/nfsiod.c')
-rw-r--r--sbin/nfsiod/nfsiod.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sbin/nfsiod/nfsiod.c b/sbin/nfsiod/nfsiod.c
index 31559cc61bd7..b1db1f1615b9 100644
--- a/sbin/nfsiod/nfsiod.c
+++ b/sbin/nfsiod/nfsiod.c
@@ -89,12 +89,12 @@ main(int argc, char *argv[])
case 'n':
num_servers = atoi(optarg);
if (num_servers < 1) {
- warnx("nfsiod count %d; reset to %d",
+ warnx("nfsiod count %u; reset to %d",
num_servers, 1);
num_servers = 1;
}
if (num_servers > MAXNFSDCNT) {
- warnx("nfsiod count %d; reset to %d",
+ warnx("nfsiod count %u; reset to %d",
num_servers, MAXNFSDCNT);
num_servers = MAXNFSDCNT;
}
@@ -109,9 +109,6 @@ main(int argc, char *argv[])
if (argc > 0)
usage();
- if (num_servers == 0)
- exit(0); /* no change */
-
len = sizeof iodmin;
error = sysctlbyname("vfs.nfs.iodmin", &iodmin, &len, NULL, 0);
if (error < 0)
@@ -120,6 +117,11 @@ main(int argc, char *argv[])
error = sysctlbyname("vfs.nfs.iodmax", &iodmax, &len, NULL, 0);
if (error < 0)
err(1, "sysctlbyname(\"vfs.nfs.iodmax\")");
+ if (num_servers == 0) { /* no change */
+ printf("vfs.nfs.iodmin=%u\nvfs.nfs.iodmax=%u\n",
+ iodmin, iodmax);
+ exit(0);
+ }
/* Catch the case where we're lowering num_servers below iodmin */
if (iodmin > num_servers) {
iodmin = num_servers;