On Sun, Dec 23, 2012 at 10:23:55PM +0100, David Coppa wrote:
> On Sun, Dec 23, 2012 at 3:18 PM, Stefan Sperling <s...@openbsd.org> wrote:
> > This diff updates the e17 ports to the final 0.17.0 release.
> >
> > There are known issues (e.g. battery module) that I'm not addressing
> > here. I want to get this upgrade out of the way first.
> 
> What's the problem with the battery module?

Maxime Villard reported it to me privately instead of the list.
I'm quoting him below (I hope he doesn't mind), instead of paraphrasing
him, so that those who are interested in the problem are in the loop.

On the surface it looks like the code should be using named constants
instead of hard-coded numbers.

--- snip ---

Hi,
do you sill use e17? If so, is the battery module working on you?
On my laptop, I get garbage values because the MIB passed to sysctl()
is 8 instead of 7. It works with this patch but I would like to know
if you get the same error as me and if this patch fixes the bug.

>From svn - src/modules/battery -, but it should not be different in
the release or somewhere else:

Index: e_mod_openbsd.c
===================================================================
--- e_mod_openbsd.c     (révision 81641)
+++ e_mod_openbsd.c     (copie de travail)
@@ -112,7 +112,7 @@
                                         battery_config->poll_interval);
     
        /* last full capacity */
-       bat->mib[3] = 8;
+       bat->mib[3] = 7;
        bat->mib[4] = 0;
        if (sysctl(bat->mib, 5, &s, &slen, NULL, 0) != -1)
          {
@@ -120,7 +120,7 @@
          }
     
        /* remaining capcity */
-       bat->mib[3] = 8;
+       bat->mib[3] = 7;
        bat->mib[4] = 3;
        if (sysctl(bat->mib, 5, &s, &slen, NULL, 0) != -1)
          {


Thanks in advance,
Maxime

Reply via email to