summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2004-04-23 04:15:27 +0000
committertedu <tedu@openbsd.org>2004-04-23 04:15:27 +0000
commitcdf09897993b9259a7510d096217a4f61d17461c (patch)
tree6c5f6194da08df9369ba2bbe6b35aef4b773a2c0
parentFix pasto in realloc portion of dkreadstats; from Pedro Martelletto (diff)
downloadwireguard-openbsd-cdf09897993b9259a7510d096217a4f61d17461c.tar.xz
wireguard-openbsd-cdf09897993b9259a7510d096217a4f61d17461c.zip
don't print stats until they're stable, prevents seeing weird stuff in
disk columns. tested by jolan@. from pedro martelletto
-rw-r--r--usr.bin/systat/vmstat.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 5d82c70cc27..d70b1f1c2ce 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.45 2004/02/15 22:56:12 tedu Exp $ */
+/* $OpenBSD: vmstat.c,v 1.46 2004/04/23 04:15:27 tedu Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.45 2004/02/15 22:56:12 tedu Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.46 2004/04/23 04:15:27 tedu Exp $";
#endif /* not lint */
/*
@@ -363,10 +363,15 @@ showkre(void)
float f1, f2;
int psiz, inttotal;
int i, l, c;
- static int failcnt = 0;
+ static int failcnt = 0, first_run = 0;
- if (state == TIME)
+ if (state == TIME) {
dkswap();
+ if (!first_run) {
+ first_run = 1;
+ return;
+ }
+ }
etime = 0;
for (i = 0; i < CPUSTATES; i++) {
X(time);