[Nut-upsdev] [PATCH 22/36] remove dead #defines and use "#if 0" to comment out code!

Arnaud Quette aquette.dev at gmail.com
Mon May 14 15:21:53 UTC 2012


2012/3/9 Greg A. Woods <woods at planix.com>:
> From: "Greg A. Woods" <woods at planix.com>
>
> ---
>  clients/upsmon.c |   12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)
>
> diff --git a/clients/upsmon.c b/clients/upsmon.c
> index fe3f5fb..33d0a64 100644
> --- a/clients/upsmon.c
> +++ b/clients/upsmon.c
> @@ -79,12 +79,6 @@ static int   opt_af = AF_UNSPEC;
>  static struct sigaction sa;
>  static sigset_t nut_upsmon_sigmask;
>
> -#ifdef SHUT_RDWR
> -#define        shutdown_how SHUT_RDWR
> -#else
> -#define        shutdown_how 2
> -#endif
> -
>  static void setflag(int *val, int flag)
>  {
>        *val |= flag;
> @@ -709,8 +703,10 @@ static void recalc(void)
>                ups = ups->next;
>        }
>
> -       /* upsdebugx(3, "Current power value: %d", val_ol);
> -       upsdebugx(3, "Minimum power value: %d", minsupplies); */
> +#if 0
> +       upsdebugx(3, "Current power value: %d", val_ol);
> +       upsdebugx(3, "Minimum power value: %d", minsupplies);
> +#endif
>
>        if (val_ol < minsupplies)
>                forceshutdown();

applied to trunk, r3587, with some adaptation:
I've enabled upsdebugx msg, since these are interesting for debug purpose:
trac.networkupstools.org/projects/nut/changeset/3587

thanks.
Arnaud
-- 
Linux / Unix Expert R&D - Eaton - http://powerquality.eaton.com
Network UPS Tools (NUT) Project Leader - http://www.networkupstools.org/
Debian Developer - http://www.debian.org
Free Software Developer - http://arnaud.quette.free.fr/



More information about the Nut-upsdev mailing list