summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcheloha <cheloha@openbsd.org>2018-02-10 19:49:50 +0000
committercheloha <cheloha@openbsd.org>2018-02-10 19:49:50 +0000
commitc1e3adfb8ee9483704e2f6c41734ef663ec779ee (patch)
treef3a79fd2aaed853fba6b36320a81d3ad83f857b3
parentPledge monitoring process; ok tedu@ (diff)
downloadwireguard-openbsd-c1e3adfb8ee9483704e2f6c41734ef663ec779ee.tar.xz
wireguard-openbsd-c1e3adfb8ee9483704e2f6c41734ef663ec779ee.zip
Cap wait/interval at 100 million seconds.
Keeps nanosleep(2) from choking. While here, call the argument to the -w flag "wait" in the error message to match up with documentation and usage(). ok tedu@ deraadt@ tb@
-rw-r--r--usr.sbin/iostat/iostat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index c85c6fc2cbb..27f710a47a2 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.39 2015/10/23 08:21:27 tedu Exp $ */
+/* $OpenBSD: iostat.c,v 1.40 2018/02/10 19:49:50 cheloha Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -146,9 +146,9 @@ main(int argc, char *argv[])
todo |= SHOW_TTY;
break;
case 'w':
- interval = strtonum(optarg, 1, INT_MAX, &errstr);
+ interval = strtonum(optarg, 1, 100000000, &errstr);
if (errstr)
- errx(1, "interval is %s", errstr);
+ errx(1, "wait is %s", errstr);
break;
case '?':
default:
@@ -419,7 +419,7 @@ selectdrives(char *argv[])
errx(1, "invalid interval or drive name: %s", *argv);
}
if (*argv) {
- interval = strtonum(*argv, 1, INT_MAX, &errstr);
+ interval = strtonum(*argv, 1, 100000000, &errstr);
if (errstr)
errx(1, "interval is %s", errstr);
if (*++argv) {