Fix DBUS error types to fix AC adapter

Danny Kukawka danny.kukawka at web.de
Mon Mar 26 13:14:18 PDT 2007


On Montag, 26. März 2007, David Zeuthen wrote:
> On Mon, 2007-03-26 at 12:53 +0200, Danny Kukawka wrote:
> > Ping
> >
> > On Montag, 19. März 2007, Danny Kukawka wrote:
> > > Would the attached patch (to avoid call dbus_error_init() again and
> > > again) work for you?
>
> It doesn't really do anything apart from making the code harder to read;
> e.g. you have to magically know that dbus_error_free() also re-
> initializes the error.. dbus_error_init() is fast.

It's irrelevant how fast dbus_error_init() is because we do what 
dbus_error_init() do already at the end of the while(), where we check if
the error is set (and the comment say clearly that this incluse 
dbus_error_init()) and cleanup/reinit the error only if needed: 

      if (dbus_error_is_set (&error)) {
           /* Free the error (which include a dbus_error_init())
              This should prevent errors if a call above fails */
           dbus_error_free (&error);
      }

The dbus_error_init() call again and again is not needed. I thought we should 
prevent calls which are not needed to speed up hal and the system.

Danny




More information about the hal mailing list