Changeset 5345

Show
Ignore:
Timestamp:
09/28/08 17:22:44 (5 years ago)
Author:
khali
Message:

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.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/branches/lm-sensors-3.0.0/prog/pwm/pwmconfig

    r5343 r5345  
    152152function print_devices() 
    153153{ 
     154        local name 
     155 
    154156        for device in $DEVICES 
    155157        do 
    156                 echo "$1$device is `cat $device/name`" 
     158                name=`cat $device/name 2> /dev/null` 
     159                [ -z "$name" ] && name="unknown (no name attribute)" 
     160                echo "$1$device is $name" 
    157161        done 
    158162}