Jan Stary wrote:
> Eventualy it does suspend, but much later than
> when the battery life goes below the specified value.

Doing more testing I noticed the same.  For example, with these options:

 # apmd -d -t 60 -z <value above current batt percentage level>

It took *5* minutes to suspend the machine.  In my first tests I passed
bigger values to -t (120 seconds) what made me think -Z was ignored.

Not a dev here but I try to learn when I have time.  I took a look to
/src/usr.sbin/apmd/ampd.c, I see there is a loop (line 507) where the
limit passed to -t is checked, then if AC is not connected the
autoaction is executed.  Time seems to be handled with a system call
(kevent), that's beyond my basic C knowledge. :-)  Perhaps some other
checking in this loop add delays, just guessing.


        Walter

Reply via email to