summaryrefslogtreecommitdiff
path: root/usr.sbin/iostat
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2002-12-16 01:57:06 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2002-12-16 01:57:06 +0000
commitda3a34e76ccd83612ffbc890187c29ee4b2960c9 (patch)
tree5e7c9b8bb5df4f4ec21ea8156ecd837aee78b2e9 /usr.sbin/iostat
parent8d617ca6e54dc39ece5af3b3a927e2dbbe2d3f1f (diff)
Make systat(1), iostat(8) and vmstat(8) automatically update their disk
statistics when a device is added/removed. ok deraadt@
Diffstat (limited to 'usr.sbin/iostat')
-rw-r--r--usr.sbin/iostat/iostat.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c
index bddb43c7227..1d1edd7b2e4 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.15 2002/08/04 00:51:01 deraadt Exp $ */
+/* $OpenBSD: iostat.c,v 1.16 2002/12/16 01:57:05 tdeval Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -96,7 +96,7 @@ static char *rcsid = "$NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $"
#include "dkstats.h"
/* Defined in dkstats.c */
-extern struct _disk cur;
+extern struct _disk cur, last;
extern int dk_ndrive;
/* Namelist and memory files. */
@@ -202,6 +202,7 @@ main(argc, argv)
break;
select(0, NULL, NULL, NULL, &tv);
dkreadstats();
+ if (last.dk_ndrive != cur.dk_ndrive) wantheader = 1;
}
exit(0);
}