summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpedro <pedro@openbsd.org>2004-08-08 00:19:16 +0000
committerpedro <pedro@openbsd.org>2004-08-08 00:19:16 +0000
commit6796d76e59b39e42da5ad032737fc8284330bd2e (patch)
tree1a3ccb0343f14ab77a13d5f750fca4fd72000e1a
parentshould have been removed when I removed the old pkg tools. (diff)
downloadwireguard-openbsd-6796d76e59b39e42da5ad032737fc8284330bd2e.tar.xz
wireguard-openbsd-6796d76e59b39e42da5ad032737fc8284330bd2e.zip
do the right math to find out what the average kbytes per transfer is
problem found and fix tested by naddy@, ok deraadt@ jolan@
-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. */