[Nut-upsdev] Re: [Nut-upsuser] Problem after reboot

Arjen de Korte nut+devel at de-korte.org
Fri Mar 3 21:23:43 UTC 2006


Arjen de Korte schreef:

> It seems that our posts crossed. I just proposed to keep the names as they
> are and just let fatal() behave as fatalx() when errno is zero, to prevent
> printing "success" where the action taken (aborting the program) clearly
> means something is very wrong. As far as I'm concerned, that should be
> enough. A different effort (and more important one) would be to be
> somewhat more verbose in telling the user what's wrong before bailing out
> with a call to fatal() or fatalx(). Displaying/logging 'getpwnam(nut)'
> just isn't very informative, even without calling it a success.

After some more thoughts, I changed my mind. Since not being able to get
a uid is a fatal error in all cases this function is called, checking
for errors (and handling them) can be implemented with no problems in
the get_user_pwent() itself. This makes it much easier to get consistent
error handling throughout all programs using it (drivers, upsd, upsmon
and upslog) and provide better feedback to the user.

Regards, Arjen



More information about the Nut-upsdev mailing list