On Sat, 12 Apr 2008 03:25:59 +0200 Stefan Scheffler <[EMAIL PROTECTED]>
babbled:

> Hi,
> batgets cpu usage goes up to 100% after resuming. 
> 
> During resume the sysfs entry for the battery briefly disappears, same
> when I take it out. I don't know if that is normal behavior
> or if my laptop is just weird..
> 
> It gets stuck in this loop while attempting to read from it:
> 
> line 454:
> 
> for (;;)
>   {
>      char buf[1024];
>      int num;
>            
>      if ((num = read(sysev->fd, buf, sizeof(buf))) < 1)
>        {
>         lost = ((errno == EIO) ||
>                 (errno == EBADF) ||
>                 (errno == EPIPE) ||
>                 (errno == EINVAL) ||
>                 (errno == ENOSPC));
>         if (num == 0) break;
>        }
>   }
> 
> Errno is set to ENODEV and read() returns -1 on error so it never leaves
> that loop.
> 
> e_battery_stuckage.diff causes batget to stop monitoring the battery
> if the file disappears.

ooh interesting NODEV. ok - this patch is in cvs.

> e_battery_dbus_sysfs.diff allows batget to monitor battery presence via
> dbus/hal. I've never done anything with dbus or efl, and my C knowledge
> is a bit shaky so this may not be completely correct. It seems to work
> fine here though.

ok - here's my first and most major comment. with dbus - going the right way,
but not really all there. dbus these days has power management api's too to
report changes in battery status, ac power plugged in/removed, etc. etc... if
you are going to go dbus, move the code. leave the event listener for acpi and
power class events as is - these are raw  and work with no dbus power
management support. instead in the e_mod_main.c for the battery module, check
dbus for it's power management service - *IF* it has one and it works, then
DONT exec batget - we don't need it. just talk dbus directly and then handle
battery add/removes, power status changes etc. from dbus. batget would be the
"legacy" battery handling. dbus would be the new stuff.

then you'd be on the right track! :)

-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to