! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
wrong path for battery info
Status:
RESOLVED: FIXED
Product:
Xfce4-sensors-plugin
Component:
General

Comments

Description Yves-Alexis Perez editbugs 2008-08-06 06:48:53 CEST
Hi,

it seems that when refreshing ACPI battery info, the wrong path is taken. get_battery_zone_value() only takes the “battery name” (the “zone”) while it's currently given ACPI_DIR_BATTERY/devicename. ACPI_DIR_BATTERY is already concatenated in get_battery_zone_value() so one ends up trying to open:

open("/proc/acpi/battery/battery/BAT0/state", O_RDONLY) = -1 ENOENT (No such file or directory)

Attached patch fix that. The first one is against current svn, the second is with the patch for #4265 applied, in case that conflicts.

Cheers,
Comment 1 Yves-Alexis Perez editbugs 2008-08-06 06:49:21 CEST
Created attachment 1755 
Fix battery path in acpi refresh
Comment 2 Yves-Alexis Perez editbugs 2008-08-06 06:49:53 CEST
Created attachment 1756 
Fix battery path in acpi refresh, with the “FAN” patch applied
Comment 3 Yves-Alexis Perez editbugs 2008-08-06 06:51:00 CEST
Comment on attachment 1756 
Fix battery path in acpi refresh, with the “FAN” patch applied

Erf, both patchs are completely the same :)
Comment 4 Fabian Nowak editbugs 2008-08-07 20:43:54 CEST
(In reply to comment #0)

Thanks for pointing out, now my battery state works again with 2.6.24; but not with 2.6.25 due to no entry /proc/acpi/battery.
Comment 5 Yves-Alexis Perez editbugs 2008-08-07 20:50:00 CEST
(In reply to comment #4)
> (In reply to comment #0)
> 
> Thanks for pointing out, now my battery state works again with 2.6.24; but not
> with 2.6.25 due to no entry /proc/acpi/battery.
> 

Well, as I said on the other bug report, /proc/acpi/* begins to be deprecated, and will be removed at one time. So yes, time to switch to sysfs :)
Comment 6 Fabian Nowak editbugs 2008-11-25 22:44:17 CET
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #0)
> > 
> > Thanks for pointing out, now my battery state works again with 2.6.24; but not
> > with 2.6.25 due to no entry /proc/acpi/battery.
> > 
> 
> Well, as I said on the other bug report, /proc/acpi/* begins to be deprecated,
> and will be removed at one time. So yes, time to switch to sysfs :)

Done in current trunk
Comment 7 Fabian Nowak editbugs 2009-01-23 20:26:43 CET
> Done in current trunk

Close me?
Comment 8 Harold Aling 2009-01-23 20:46:41 CET
"Done in current trunk"

Bug #4266

Reported by:
Yves-Alexis Perez
Reported on: 2008-08-06
Last modified on: 2009-07-15

People

Assignee:
Xfce-Goodies Maintainers
CC List:
2 users

Version

Version:
unspecified

Attachments

Additional information