Changeset 4280

Show
Ignore:
Timestamp:
01/05/07 17:34:32 (6 years ago)
Author:
khali
Message:

pwmconfig, fancontrol: Gracefully handle errors when writing to
sysfs files, as bash 3.1 otherwise displays them and this tends to
frighten the user.

Location:
lm-sensors/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lm-sensors/trunk/CHANGES

    r4277 r4280  
    2626  Program py-smbus: New! Python i2c-dev bindings (prog/py-smbus) 
    2727  Programs dump/*: More robust handling of user inputs 
     28  Programs pwmconfig, fancontrol: Handle write errors for bash 3.1 
    2829  Program sensord: Add pc87247 support (fans only) 
    2930                   Add vt1211 support (#2150) 
  • lm-sensors/trunk/prog/pwm/fancontrol

    r4064 r4280  
    125125                if [ -f $ENABLE ] 
    126126                then 
    127                         echo 0 > $ENABLE 
     127                        echo 0 > $ENABLE 2> /dev/null 
    128128                fi 
    129129        else 
     
    140140                if [ -f $ENABLE ] 
    141141                then 
    142                         echo 1 > $ENABLE 
    143                 fi 
     142                        echo 1 > $ENABLE 2> /dev/null 
     143                        if [ $? -ne 0 ] 
     144                        then 
     145                                return 1 
     146                        fi 
     147                fi 
     148                echo $MAX > $1 
    144149        else 
    145150                echo $MAX 1 > $1 
  • lm-sensors/trunk/prog/pwm/pwmconfig

    r4153 r4280  
    100100                if [ -w $ENABLE ] 
    101101                then 
    102                         echo 0 > $ENABLE 
     102                        echo 0 > $ENABLE 2> /dev/null 
    103103                fi 
    104104        else 
     
    115115                if [ -w $ENABLE ] 
    116116                then 
    117                         echo 1 > $ENABLE 
    118                 fi 
     117                        echo 1 > $ENABLE 2> /dev/null 
     118                        if [ $? -ne 0 ] 
     119                        then 
     120                                return 1 
     121                        fi 
     122                fi 
     123                echo $MAX > $1 
    119124        else 
    120125                echo $MAX 1 > $1 
     
    272277        echo Testing pwm control $i ... 
    273278        pwmenable $i 
     279        if [ $? -ne 0 ] 
     280        then 
     281                echo "Manual control mode not supported, skipping." 
     282                continue 
     283        fi 
    274284        pwmset $i 0 
    275285        sleep $DELAY