GNOME Bugzilla – Bug 114937
uncorrect parsing of proc file with old ACPI version
Last modified: 2004-12-22 21:47:04 UTC
Package: battfink Severity: major Version: 2.2.2 Synopsis: uncorrect parsing of proc file with old ACPI version Bugzilla-Product: battfink Bugzilla-Component: general Description: Description of Problem: with old acpi versions (older than 20020208), the files /battery/*/state used to be called /battery/*/status (battfink handles a similar issue with /ac_adapter) Steps to reproduce the problem: 1. install an unpatched 2.4.20 kernel on an acpi laptop 2. launch the applet Actual Results: always showing 0% battery Expected Results: a correct percentage How often does this happen? always Additional Information: a patch : --- battfink-acpi.c.old 2003-06-11 15:04:09.000000000 +0200 +++ battfink-acpi.c 2003-06-11 16:18:51.000000000 +0200 @@ -135,7 +135,7 @@ gulong acpi_ver; char buf[BUFSIZ]; GHashTable *hash; - const char *ac_state_state, *charging_state; + const char *ac_state_state, *batt_state_state, *charging_state; char batt_info[60], batt_state[60], ac_state[60]; DIR * procdir; struct dirent * procdirentry; @@ -166,9 +166,11 @@ if (acpi_ver < (gulong)20020208) { ac_state_state = "status"; + batt_state_state = "status"; charging_state = "state"; } else { ac_state_state = "state"; + batt_state_state = "state"; charging_state = "charging state"; } @@ -193,7 +195,8 @@ } strcpy(batt_state,"/proc/acpi/battery/"); strcat(batt_state,procdirentry->d_name); - strcat(batt_state,"/state"); + strcat(batt_state,"/"); + strcat(batt_state,batt_state_state); hash = read_file (batt_state, buf, sizeof (buf)); if (hash) { ------- Bug moved to this database by unknown@bugzilla.gnome.org 2003-06-11 10:25 ------- Reassigning to the default owner of the component, glynn.foster@sun.com.
Adding PATCH keyword and marking priority as high due to the PATCH. Also, adding bugsquad keyword and marking as new.
Okay, I've committed this to cvs.gnome.org. Thanks very much for the patch!