From 800e4e91516901fb6064b085913c2ee8bbe4399d Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 28 Feb 2018 10:41:17 +0100 Subject: [PATCH 1/2] drivers/snmp-ups.c : bump the version for public-release driver fix --- drivers/snmp-ups.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index 89986e2cd6..96c7508e6e 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -168,7 +168,7 @@ const char *mibvers; #else # define DRIVER_NAME "Generic SNMP UPS driver" #endif /* WITH_DMFMIB */ -#define DRIVER_VERSION "1.04" +#define DRIVER_VERSION "1.05" /* driver description structure */ upsdrv_info_t upsdrv_info = { From e8ea953d3f2556e96c8965eb00dc2246afbf1971 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Wed, 28 Feb 2018 14:00:45 +0100 Subject: [PATCH 2/2] snmp-ups.c : Fix indentation for recent fixes --- drivers/snmp-ups.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index 96c7508e6e..64738c985f 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -1753,8 +1753,8 @@ void free_info(snmp_info_t *su_info_p) * the MIB, based on a test using a template OID */ int base_snmp_template_index(const snmp_info_t *su_info_p) { - if (!su_info_p) - return -1; + if (!su_info_p) + return -1; int base_index = -1; char test_OID[SU_INFOSIZE]; @@ -2224,23 +2224,23 @@ bool_t daisychain_init() dstate_setinfo("device.model", "daisychain (1+%ld)", devices_count - 1); } } - } + } else { daisychain_enabled = FALSE; upsdebugx(1, "No device.count entry found, daisychain support not needed"); } - /* Finally, compute and store the base OID index and NUT offset */ - su_info_p = su_find_info("device.model"); - if (su_info_p != NULL) { - device_template_index_base = base_snmp_template_index(su_info_p); - upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base); - device_template_offset = device_template_index_base - 1; - upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset); - } - else { - upsdebugx(1, "%s: No device.model entry found.", __func__); - } + /* Finally, compute and store the base OID index and NUT offset */ + su_info_p = su_find_info("device.model"); + if (su_info_p != NULL) { + device_template_index_base = base_snmp_template_index(su_info_p); + upsdebugx(1, "%s: device_template_index_base = %i", __func__, device_template_index_base); + device_template_offset = device_template_index_base - 1; + upsdebugx(1, "%s: device_template_offset = %i", __func__, device_template_offset); + } + else { + upsdebugx(1, "%s: No device.model entry found.", __func__); + } return daisychain_enabled; }