HAL battery backend, new thread!

David Zeuthen david at fubar.dk
Mon Aug 1 17:49:19 PDT 2005


On Mon, 2005-08-01 at 22:37 +0200, Danny Kukawka wrote:
> On Monday 01 August 2005 19:20, David Zeuthen wrote:
> > Looks good - I've committed this and the doc patch. Thanks a lot!
> 
> The patch is broken. HAL segfaults on a Laptop with 2 battery bays but only 
> with one battery in function battery_refresh_poll() in line: 
> 
> 	"if (strcmp (reporting_unit, "mWh") == 0) {"
> 
> The reason: battery_refresh_poll() polls the battery also if the battery bay 
> is empty and no battery present. The attached patch should fix this.

I've committed this patch - I've also added some more defensive measures
to e.g. bail out if the property battery.reporting.unit is missing
(which is what ultimately causes the segfault I think).

> I have currently no battery for bay BAT1, so I can't test what happens if you 
> insert the battery while machine is running. But I test this tomorrow.

Thanks for this.

Cheers,
David


_______________________________________________
hal mailing list
hal at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list