[Nut-upsdev] [nut-commits] svn commit r971 - in trunk: . drivers

Arnaud Quette aquette.dev at gmail.com
Fri Jun 22 13:07:13 UTC 2007


2007/6/21, Arjen de Korte <nut+devel at de-korte.org>:
>
> > Author: aquette
> > Date: Thu Jun 21 07:43:46 2007
> > New Revision: 971
> >
> > Log:
> > fix communication lost status handling
> >
> > Modified:
> >    trunk/ChangeLog
> >    trunk/drivers/usbhid-ups.c
> >
> > Modified: trunk/ChangeLog
> > ==============================================================================
> > --- trunk/ChangeLog   (original)
> > +++ trunk/ChangeLog   Thu Jun 21 07:43:46 2007
> > @@ -1,3 +1,8 @@
> > +Thu Jun 21 07:07:25 UTC 2007 / Arnaud Quette <aquette.dev at gmail.com>
> > +
> > + - usbhid-ups: improve the handling and reporting of the communication
> > +   lost status. Previously, these were not reported anymore.
> > +
> >  Web Jun 20 22:14:43 UTC 2007 / Carlos Rodrigues
> > <carlos.efr at mail.telepac.pt>
> >
> >   - drivers/megatec.c, drivers/megatec_usb.c: reverted changes to
> >
> > Modified: trunk/drivers/usbhid-ups.c
> > ==============================================================================
> > --- trunk/drivers/usbhid-ups.c        (original)
> > +++ trunk/drivers/usbhid-ups.c        Thu Jun 21 07:43:46 2007
> > @@ -987,7 +987,7 @@
> >
> >  static void reconnect_ups(void)
> >  {
> > -     if (hd == NULL)
> > +     while (hd == NULL)
>         ^^^^^^^^^^^^^^^^^^
> If the communication to the UPS is lost (and can't be established again),
> it will stay in this loop forever and therefor never leave the
> upsdrv_updateinfo() function. This is bad for two reasons:
>
> #1 The driver won't respond to a termination signal anymore, since the
> exit_flag (that is set by a SIGTERM for instance) is not evaluated in
> upsdrv_updateinfo().
>
> #2 The driver won't respond to the server either, so it will appear (and
> be flagged) dead, while the actual problem is in the connection to the
> UPS. People might try to restart it, which isn't going to work due to #1
> mentioned above.
>
> We warn for this behaviour in 'docs/new-drivers.txt':
> ...

oooch, fully right. thanks Arjen for your continued proof reading.

it seems that my brain is currently too absorbed by the APC | MGE and
now Eaton / Powerware things...
http://www.eaton.com/EatonCom/Markets/Electrical/CT_127054

cleaner fix applied.
-- Arnaud



More information about the Nut-upsdev mailing list