usr/lib/byobu/disk_io: fix scaling, LP: #787773

This commit is contained in:
Dustin Kirkland 2011-05-24 22:24:48 -05:00
commit 18d24bbb76
2 changed files with 8 additions and 3 deletions

1
debian/changelog vendored
View file

@ -2,6 +2,7 @@ byobu (4.3) unreleased; urgency=low
* usr/lib/byobu/uptime: fix string bug in uptime introduced by smoser's
changes
* usr/lib/byobu/disk_io: fix scaling, LP: #787773
-- Dustin Kirkland <kirkland@ubuntu.com> Mon, 23 May 2011 19:21:36 -0500

View file

@ -77,11 +77,15 @@ for i in "read" "write"; do
if [ "$rate" -lt 0 ]; then
rate=0
elif [ "$rate" -gt 1048576 ]; then
fpdiv "$rate" 1048576 1
unit="GB/s"
fpdiv "$rate" 1048576 0
rate=${_RET}
elif [ "$rate" -gt 1024 ]; then
fpdiv "$rate" 1024 1
unit="MB/s"
fpdiv "$rate" 1024 0
rate=${_RET}
else
unit="kB/s"
fi
fi
[ "$rate" != "0" ] || continue