* usr/lib/byobu/disk_io:

- ensure some values are set to zero, if unreadable
  - fixes a bug where disk_io causes the rest of the status line to fail
This commit is contained in:
Dustin Kirkland 2019-06-11 19:01:41 -05:00
commit e991e535e4
2 changed files with 6 additions and 3 deletions

3
debian/changelog vendored
View file

@ -22,6 +22,9 @@ byobu (5.128) unreleased; urgency=medium
- prefer iwconfig over iw for now, iw is not working for me
* usr/share/byobu/profiles/tmux:
- flatten some of our color configuration to match the new tmux format
* usr/lib/byobu/disk_io:
- ensure some values are set to zero, if unreadable
- fixes a bug where disk_io causes the rest of the status line to fail
[ Fede Luzzi ]
* usr/lib/byobu/include/mondrian, usr/share/byobu/profiles/tmux:

View file

@ -62,15 +62,15 @@ __disk_io() {
if [ $t2 -le $t1 ]; then
rate=0
else
[ -r "$cache" ] && read x1 < "$cache"
[ -r "$cache" ] && read x1 < "$cache" || x1=0
local a1= a2= a3= a4= a5= a6= a7= a8= a9= a10=
read a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 other < "/sys/block/$disk/stat"
if [ "$i" = "read" ]; then
symbol="$ICON_RD"
x2="$a3"
[ -n "$a3" ] && x2="$a3" || x2=0
else
symbol="$ICON_WR"
x2="$a7"
[ -n "$a7" ] && x2="$a7" || x2=0
fi
printf "%s" "$x2" > "$cache"
rate=$((($x2 - $x1) / ($t2 - $t1) * 512 / 1024))