summaryrefslogtreecommitdiff
path: root/usr.bin/systat
diff options
context:
space:
mode:
authorCan Erkin Acar <canacar@cvs.openbsd.org>2008-06-13 01:24:56 +0000
committerCan Erkin Acar <canacar@cvs.openbsd.org>2008-06-13 01:24:56 +0000
commitbeaa5bca209a717af85bae9aa493334eba7b0c7c (patch)
treeb1a60a4f78883f474e5ceb36b4f8b02cf324dfc9 /usr.bin/systat
parent5fa1280f156c4952ec337ffec5d133f72e8f9ddb (diff)
Set 'naptime' which is used by the interface page in differential mode.
Also remove a debugging message while there. reported by claudio@
Diffstat (limited to 'usr.bin/systat')
-rw-r--r--usr.bin/systat/main.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index 3896455ab82..fa96d97d1be 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.38 2008/06/12 22:26:01 canacar Exp $ */
+/* $Id: main.c,v 1.39 2008/06/13 01:24:55 canacar Exp $ */
/*
* Copyright (c) 2001, 2007 Can Erkin Acar
* Copyright (c) 2001 Daniel Hartmeier
@@ -311,10 +311,11 @@ cmd_delay(void)
{
double del;
del = atof(cmdbuf);
- error("delay: %g", del);
+
if (del > 0) {
udelay = (useconds_t)(del * 1000000);
gotsig_alarm = 1;
+ naptime = del;
}
}
@@ -440,7 +441,7 @@ main(int argc, char *argv[])
break;
case 's':
delay = atof(optarg);
- if (delay < 0)
+ if (delay <= 0)
delay = 5;
break;
case 'S':
@@ -481,6 +482,8 @@ main(int argc, char *argv[])
if (udelay < 1)
udelay = 1;
+ naptime = (double)udelay / 1000000.0;
+
gethostname(hostname, sizeof (hostname));
gethz();