hal: Branch 'master'

Richard Hughes hughsient at kemper.freedesktop.org
Thu Aug 31 12:41:51 PDT 2006


 tools/hal-system-lcd-set-brightness |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

New commits:
diff-tree 8f7c69240f0dd1fbfbcb813c7ba8cc9ba8558696 (from fef0ddad7bd5853373cbbf430497d6ec16862cd7)
Author: Richard Hughes <richard at hughsie.com>
Date:   Thu Aug 31 20:41:24 2006 +0100

    fix message when we try to set a brightness above range
    
    Setting the brightness above range on the command line gives:
    
    [hughsie at hughsie-laptop hal]$ dbus-send --system --print-reply
    --dest=org.freedesktop.Hal /org/freedesktop/Hal/devices/acpi_lcd
    org.freedesktop.Hal.Device.LaptopPanel.SetBrightness int32:8
    Error org.freedesktop.Hal.Device.LaptopPanel.Invalid: Brightness has to
    be between 0 and 8!
    
    So the message is telling us to set a value between 0-8, which we really
    are trying to do! The correct message would be to tell us the range was
    0->7.

diff --git a/tools/hal-system-lcd-set-brightness b/tools/hal-system-lcd-set-brightness
index b5cc560..a677412 100755
--- a/tools/hal-system-lcd-set-brightness
+++ b/tools/hal-system-lcd-set-brightness
@@ -24,7 +24,7 @@ read value
 # Check for values outside range
 if [ ${value} -lt 0 ] || [ ${value} -ge $HAL_PROP_LAPTOP_PANEL_NUM_LEVELS ]; then
 	echo "org.freedesktop.Hal.Device.LaptopPanel.Invalid" >&2
-	echo "Brightness has to be between 0 and $HAL_PROP_LAPTOP_PANEL_NUM_LEVELS!" >&2
+	echo "Brightness has to be between 0 and $((HAL_PROP_LAPTOP_PANEL_NUM_LEVELS - 1))" >&2
 	exit 1
 fi
 


More information about the hal-commit mailing list