aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat/main.c
diff options
context:
space:
mode:
authorRobert Watson <rwatson@FreeBSD.org>2000-12-17 18:43:28 +0000
committerRobert Watson <rwatson@FreeBSD.org>2000-12-17 18:43:28 +0000
commit48c193e1831c96247a8f6c7089690f8a71a23035 (patch)
treeb3fc59acc8097c0bc11678c1c2a45b008cf902de /usr.bin/systat/main.c
parent95b2cbbc1708d2420b18db73b1a90c81a780d5b1 (diff)
downloadsrc-48c193e1831c96247a8f6c7089690f8a71a23035.tar.gz
src-48c193e1831c96247a8f6c7089690f8a71a23035.zip
Notes
Diffstat (limited to 'usr.bin/systat/main.c')
-rw-r--r--usr.bin/systat/main.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/usr.bin/systat/main.c b/usr.bin/systat/main.c
index f524dcacb878..52bb1e579671 100644
--- a/usr.bin/systat/main.c
+++ b/usr.bin/systat/main.c
@@ -46,6 +46,7 @@ static const char rcsid[] =
#endif /* not lint */
#include <sys/param.h>
+#include <sys/time.h>
#include <err.h>
#include <locale.h>
@@ -66,7 +67,7 @@ double avenrun[3];
int col;
int naptime = 5;
int verbose = 1; /* to report kvm read errs */
-struct clockinfo clkinfo;
+struct clockinfo clkinfo;
double hertz;
char c;
char *namp;
@@ -81,7 +82,7 @@ main(argc, argv)
int argc;
char **argv;
{
- char errbuf[80];
+ char errbuf[80];
size_t size;
int err;
@@ -133,15 +134,13 @@ main(argc, argv)
die(0);
}
gethostname(hostname, sizeof (hostname));
-
size = sizeof(clkinfo);
err = sysctlbyname("kern.clockrate", &clkinfo, &size, NULL, 0);
if (err != 0 || size != sizeof(clkinfo)) {
- perror("kern.clockrate");
+ error("kern.clockrate");
die(0);
}
-
- hertz = clkinfo.stathz ? clkinfo.stathz : clkinfo.hz;
+ hertz = clkinfo.stathz;
(*curcmd->c_init)();
curcmd->c_flags |= CF_INIT;
labels();