summaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 07:49:17 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-10 07:49:17 +0000
commitd716c0fd33ee296c6f3d51c12839e3489106f432 (patch)
treec6a9ee2f5a35ea7c273e4f53b81319bb1152e257 /usr.bin/vmstat
parent38e9936a94dc4b2255c08c92d794c6bbda00bf19 (diff)
boottime is a timeval
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 86dd3d49bb6..8644cd6250d 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.29 1996/05/10 23:19:32 thorpej Exp $ */
+/* $NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $ */
/*
* Copyright (c) 1980, 1986, 1991, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)vmstat.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$NetBSD: vmstat.c,v 1.29 1996/05/10 23:19:32 thorpej Exp $";
+static char rcsid[] = "$NetBSD: vmstat.c,v 1.29.4.1 1996/06/05 00:21:05 cgd Exp $";
#endif
#endif /* not lint */
@@ -346,13 +346,14 @@ choosedrives(argv)
long
getuptime()
{
- static time_t now, boottime;
+ static time_t now;
+ static struct timeval boottime;
time_t uptime;
- if (boottime == 0)
+ if (boottime.tv_sec == 0)
kread(X_BOOTTIME, &boottime, sizeof(boottime));
(void)time(&now);
- uptime = now - boottime;
+ uptime = now - boottime.tv_sec;
if (uptime <= 0 || uptime > 60*60*24*365*10) {
(void)fprintf(stderr,
"vmstat: time makes no sense; namelist must be wrong.\n");