diff --git a/debian/changelog b/debian/changelog index 898a9e98..0653b5fb 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,8 @@ byobu (3.20) unreleased; urgency=low * usr/lib/byobu/cpu_temp: find the temp monitor, LP: #676080 * usr/lib/byobu/battery, usr/share/man/man1/byobu.1: allow for overriding detected BATTERY, LP: #693560 + * usr/lib/byobu/cpu_temp: test that file exists, is readable, and has + size > 0, LP: #696071 -- Dustin Kirkland Tue, 28 Dec 2010 00:05:13 -0600 diff --git a/usr/lib/byobu/cpu_temp b/usr/lib/byobu/cpu_temp index 4d35137c..69bef9bf 100755 --- a/usr/lib/byobu/cpu_temp +++ b/usr/lib/byobu/cpu_temp @@ -34,10 +34,10 @@ fi for i in $MONITORED_TEMP /sys/class/hwmon/hwmon*/temp*_input /proc/acpi/ibm/thermal $DIR/*/temperature; do case "$i" in *temp*_input) - t=$(awk '{printf "%0.f",$1/1000}' "$i") + [ -s "$i" ] && t=$(awk '{printf "%0.f",$1/1000}' "$i") ;; *) - t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i") + [ -s "$i" ] && t=$(sed -e "s/^[^0-9]\+//" -e "s/\s.*$//" "$i") ;; esac if [ -n "$t" ]; then