[patch] Move negative checks to util.c, from acpi.c (resend)

Danny Kukawka danny.kukawka at web.de
Wed Aug 17 20:35:31 PDT 2005


On Thursday 18 August 2005 03:36, David Zeuthen wrote:
> You raise some good points..
>
> Actually, I'd rather we set the percentage to 100% and remaining time to
> some high number too (either a number made up or derived from design
> capacity etc.) in order to let e.g. gnome-power-manager et. al. not do
> any crazy actions like shutting down..

But what's the difference between a check for a value higher 100 (and what 
would you set for remaining time?) and a check for -1/<0 ?

> I'm not sure we want -1 because that will make it more difficult to
> implement gnome-power-manager et. al. and, really, 

See above. Since a negative value is the only value you never want for 
remaining time or/and percentage this should be easy to check and the only 
value without conflicts.

And if g-p-m not crashed with hal-0.5.3 it should also work with -1 as value 
for e.g. remaining time since it could happend to get negative values e.g. 
with util_compute_time_remaining() (eg.g if like on some machines here the 
last full capacity is lower than the current) in this hal version.

> the main point is 
> that the bug with ACPI is something that should be fixed.. In other
> words, I don't think we should design for broken hardware... I'm not
> super religious about this - what does other people think?

I understood your intention. Yes it would be really cool to have only hardware 
without broken ACPI Implementation. But this is not the reality. There are so 
many broken systems (maybe more broken than correct ;-)) We can't fix the 
hardware. I think we should also (if it's easy) workaround broken ACPI 
hardware. 

Cheers,

Danny


More information about the hal mailing list