After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 114937 - uncorrect parsing of proc file with old ACPI version
uncorrect parsing of proc file with old ACPI version
Status: RESOLVED FIXED
Product: battfink
Classification: Deprecated
Component: general
unspecified
Other other
: High normal
: ---
Assigned To: Glynn Foster
Glynn Foster
Depends on:
Blocks:
 
 
Reported: 2003-06-11 14:25 UTC by Yann Bloch
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Yann Bloch 2003-06-11 14:25:33 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.

Comment 1 Elijah Newren 2003-06-12 04:59:47 UTC
Adding PATCH keyword and marking priority as high due to the PATCH. 
Also, adding bugsquad keyword and marking as new.
Comment 2 Glynn Foster 2003-06-23 22:41:28 UTC
Okay, I've committed this to cvs.gnome.org. Thanks very much for the
patch!