Skip to content

Commit

Permalink
drivers/apcupsd-ups.c: fix check for POLL_INTERVAL_MIN [networkupstoo…
Browse files Browse the repository at this point in the history
…ls#2007, networkupstools#797 fallout]

Signed-off-by: Jim Klimov <[email protected]>
  • Loading branch information
jimklimov committed Aug 3, 2023
1 parent 80767e3 commit 7b0d582
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/apcupsd-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef unsigned long int nfds_t;
#include "nut_stdint.h"

#define DRIVER_NAME "apcupsd network client UPS driver"
#define DRIVER_VERSION "0.70"
#define DRIVER_VERSION "0.71"

#define POLL_INTERVAL_MIN 10

Expand Down Expand Up @@ -331,15 +331,15 @@ void upsdrv_initinfo(void)
if(getdata())fatalx(EXIT_FAILURE,"can't communicate with apcupsd!");
else dstate_dataok();

poll_interval = (poll_interval > POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval;
poll_interval = (poll_interval < POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval;
}

void upsdrv_updateinfo(void)
{
if(getdata())upslogx(LOG_ERR,"can't communicate with apcupsd!");
else dstate_dataok();

poll_interval = (poll_interval > POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval;
poll_interval = (poll_interval < POLL_INTERVAL_MIN) ? POLL_INTERVAL_MIN : poll_interval;
}

void upsdrv_shutdown(void)
Expand Down

0 comments on commit 7b0d582

Please sign in to comment.