[laptop-mode] Error in the hal-polling module
Vincent Panel
yohonet at gmail.com
Thu Apr 16 17:19:41 CEST 2009
Hi,
You can read in this module the following code :
# Some backward compatibility for version 1.42
if [ x$BATT_ENABLE_HAL_POLLING = x1 ] ; then
BATT_DISABLE_HAL_POLLING=0
else
BATT_DISABLE_HAL_POLLING=1
fi
if [ x$AC_ENABLE_HAL_POLLING = x1 ] ; then
AC_DISABLE_HAL_POLLING=0
else
AC_DISABLE_HAL_POLLING=1
fi
The problem is that it does not do what's in the comment : it
overrides completely the preferences set in the config file. This code
purely sets BATT_DISABLE_HAL_POLLING to 0 or 1 whatever is set for the
value of this variable in the config file.
The code should be changed to something like this :
# Some backward compatibility for version 1.42
if [ ! x$BATT_ENABLE_HAL_POLLING = x ] ; then
if [ x$BATT_ENABLE_HAL_POLLING = x1 ] ; then
BATT_DISABLE_HAL_POLLING=0
else
BATT_DISABLE_HAL_POLLING=1
fi
fi
if [ ! x$AC_ENABLE_HAL_POLLING = x ] ; then
if [ x$AC_ENABLE_HAL_POLLING = x1 ] ; then
AC_DISABLE_HAL_POLLING=0
else
AC_DISABLE_HAL_POLLING=1
fi
fi
Regards,
Vincent
More information about the laptop-mode
mailing list