Don't choke on missing name attribute. Drivers shouldn't do that, but

we can live without the name attribute, so there's no point in failing.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@5345 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare committed 2008-09-28 15:22:44 +00:00
1 parent 66130a9630
commit 5f269d0f10
1 file changed
+5 -1
+5 -1
View File
@@ -151,9 +151,13 @@ fi
# Only works with Linux 2.6
function print_devices()
{
local name
for device in $DEVICES
do
echo "$1$device is `cat $device/name`"
name=`cat $device/name 2> /dev/null`
[ -z "$name" ] && name="unknown (no name attribute)"
echo "$1$device is $name"
done
}