[Nut-upsdev] [Nut-upsuser] Belkin F6C1100-UNV

Peter Selinger selinger at mathstat.dal.ca
Thu May 24 01:03:45 UTC 2007


Arjen de Korte wrote:
> 
> Eric S. Raymond wrote:
> 
> >> Of course this will require massive amount of small changes to pretty much
> >> all sources (including non-drivers), but has the advantage that many
> >> drivers already use their own descriptive messages which would be printed
> >> right before the call to exit() by fatalx() and fatal_with_errno()
> > Seems like a good plan.
> 
> There is one little snag here. At least one driver (belkinunv) already
> uses the exit status. This needs to be dealt with in a clean way, so we
> probably need to allow a certain range of exit codes for internal driver
> use.

I wrote that driver. The reason for the exit status is that belkinunv
can be used in a non-NUT environment; this was necessitated by
Belkin's braindead hardware which could not handle shutdown and
startup smartly (see belkinunv(8)). The additional exit statuses are
only relevant when the driver is called as a "standalone" program with
the -x wait or -x nohang options. They are not in effect when
belkinunv is called "the normal way" via upsdrvctl. So there should be
no real interference of exit codes.

-- Peter
 
> Furthermore, we probably can't use EXIT_FAILURE for portability reasons,
> since that's only guaranteed to be non-zero and therefor it would be
> impossible to add other return codes (we might duplicate EXIT_FAILURE then).
> 
> Best regards, Arjen
> 
> _______________________________________________
> Nut-upsdev mailing list
> Nut-upsdev at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsdev
> 




More information about the Nut-upsdev mailing list