• Bug#266643: laptop-mode-tools: division by 0 in /etc/acpi/actions/lm_ba

    From Ludovic Rousseau@1:229/2 to All on Wed Aug 18 17:00:19 2004
    From: [email protected]

    Package: laptop-mode-tools
    Version: 0.97-1
    Severity: normal

    Hi,

    My ACPI system does not provide the discharging present rate. I have:
    $ cat /proc/acpi/battery/BAT1/state
    present: yes
    capacity state: ok
    charging state: discharging
    present rate: 0 mA
    remaining capacity: 6450 mAh
    present voltage: 12540 mV

    So the script fails with an error in the logs:
    /etc/acpi/actions/lm_battery.sh: line 27: ((: 6322 * 60 / 0 < 10: division by 0 (error token is "< 10")
    since $PRESENT_RATE is set to 0.

    Maybe the best would be to skip this test if PRESENT_RATE == 0.


    Note that a new version 0.97 is available at http://www.xs4all.nl/~bsamwel/laptop_mode/tools/.

    -- System Information:
    Debian Release: 3.1
    APT prefers unstable
    APT policy: (500, 'unstable')
    Architecture: i386 (i686)
    Kernel: Linux 2.6.8.1
    Locale: LANG=fr_FR, LC_CTYPE=fr_FR

    -- no debconf information


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Bart Samwel@1:229/2 to Ludovic Rousseau on Wed Aug 18 17:50:09 2004
    From: [email protected]

    Ludovic Rousseau wrote:
    So the script fails with an error in the logs:
    /etc/acpi/actions/lm_battery.sh: line 27: ((: 6322 * 60 / 0 < 10: division by 0 (error token is "< 10")
    since $PRESENT_RATE is set to 0.

    Maybe the best would be to skip this test if PRESENT_RATE == 0.

    That would be good, yes. Thanks!

    Note that a new version 0.97 is available at http://www.xs4all.nl/~bsamwel/laptop_mode/tools/.

    I know, I'm the "bsamwel" in that URL. Expect 0.98 to be available soon. :)

    --Bart


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)
  • From Bart Samwel@1:229/2 to Ludovic Rousseau on Wed Aug 18 23:20:06 2004
    From: [email protected]

    On Wed, 2004-08-18 at 16:45 +0200, Ludovic Rousseau wrote:
    My ACPI system does not provide the discharging present rate.

    This should be fixed in 0.98+ (pending upload). If you want to try it
    now, you can download the package at the laptop-mode-tools page:

    http://www.xs4all.nl/~bsamwel/laptop_mode/tools

    --
    Bart Samwel <[email protected]>


    --
    To UNSUBSCRIBE, email to [email protected]
    with a subject of "unsubscribe". Trouble? Contact [email protected]

    --- SoupGate-Win32 v1.05
    * Origin: you cannot sedate... all the things you hate (1:229/2)