From 5f269d0f10227c6739b3ff4c152c59e729f528f2 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Sun, 28 Sep 2008 15:22:44 +0000 Subject: [PATCH] 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 --- prog/pwm/pwmconfig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/prog/pwm/pwmconfig b/prog/pwm/pwmconfig index 57cc98ee..c705f3e8 100755 --- a/prog/pwm/pwmconfig +++ b/prog/pwm/pwmconfig @@ -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 }