Module Name: src
Committed By: sborrill
Date: Tue Oct 30 10:54:25 UTC 2018
Modified Files:
src/usr.bin/systat [netbsd-7]: main.c
Log Message:
Pull up the following revisions(s) (requested by mrg in ticket #1639):
usr.bin/systat/main.c: revision 1.52 via patch
Add missing 'b' to the list of options.
Alpha-sort the option handling.
To generate a diff of this commit:
cvs rdiff -u -r1.48.2.1 -r1.48.2.2 src/usr.bin/systat/main.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/systat/main.c
diff -u src/usr.bin/systat/main.c:1.48.2.1 src/usr.bin/systat/main.c:1.48.2.2
--- src/usr.bin/systat/main.c:1.48.2.1 Mon Sep 4 06:04:06 2017
+++ src/usr.bin/systat/main.c Tue Oct 30 10:54:25 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.48.2.1 2017/09/04 06:04:06 snj Exp $ */
+/* $NetBSD: main.c,v 1.48.2.2 2018/10/30 10:54:25 sborrill Exp $ */
/*-
* Copyright (c) 1980, 1992, 1993
@@ -36,7 +36,7 @@ __COPYRIGHT("@(#) Copyright (c) 1980, 19
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-__RCSID("$NetBSD: main.c,v 1.48.2.1 2017/09/04 06:04:06 snj Exp $");
+__RCSID("$NetBSD: main.c,v 1.48.2.2 2018/10/30 10:54:25 sborrill Exp $");
#endif /* not lint */
#include <sys/param.h>
@@ -102,7 +102,7 @@ main(int argc, char **argv)
egid = getegid();
(void)setegid(getgid());
- while ((ch = getopt(argc, argv, "M:N:nw:t:")) != -1)
+ while ((ch = getopt(argc, argv, "M:N:bnw:t:")) != -1)
switch(ch) {
case 'M':
memf = optarg;
@@ -110,19 +110,19 @@ main(int argc, char **argv)
case 'N':
nlistf = optarg;
break;
+ case 'b':
+ bflag = !bflag;
+ break;
case 'n':
nflag = !nflag;
break;
- case 'w':
- if ((naptime = atoi(optarg)) <= 0)
- errx(1, "interval <= 0.");
- break;
case 't':
if ((turns = atoi(optarg)) <= 0)
errx(1, "turns <= 0.");
break;
- case 'b':
- bflag = !bflag;
+ case 'w':
+ if ((naptime = strtod(optarg, NULL)) <= 0)
+ errx(1, "interval <= 0.");
break;
case '?':
default: