summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2004-08-08 00:19:17 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2004-08-08 00:19:17 +0000
commitb1b469ce8a1fa4dea9f497d4b11c01389dda4de0 (patch)
tree3f449ccbe6f91e8b03a9e3df33974ce0e6bb2a66 /usr.sbin
parent7876be2dea491dd44349b68ec092c4e6335841d7 (diff)
do the right math to find out what the average kbytes per transfer is
problem found and fix tested by naddy@, ok deraadt@ jolan@
Diffstat (limited to 'usr.sbin')
-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 36a23ace2ea..7084284ecde 100644
--- a/usr.sbin/iostat/iostat.c
+++ b/usr.sbin/iostat/iostat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iostat.c,v 1.20 2004/08/01 18:32:19 deraadt Exp $ */
+/* $OpenBSD: iostat.c,v 1.21 2004/08/08 00:19:16 pedro Exp $ */
/* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */
/*
@@ -264,10 +264,11 @@ disk_stats(double etime)
/* average Kbytes per transfer. */
if (cur.dk_rxfer[dn] + cur.dk_wxfer[dn])
- mbps = ((cur.dk_rxfer[dn] + cur.dk_wxfer[dn]) /
+ mbps = ((cur.dk_rbytes[dn] + cur.dk_wbytes[dn]) /
(1024.0)) / (cur.dk_rxfer[dn] + cur.dk_wxfer[dn]);
else
mbps = 0.0;
+
(void)printf(" %5.2f", mbps);
/* average transfers per second. */