From 1fa92d7492285a730ecec29078def086e2fe46e7 Mon Sep 17 00:00:00 2001 From: Jim Klimov Date: Tue, 16 Jul 2024 17:56:27 +0200 Subject: [PATCH] tools/nut-scanner/scan_snmp.c: cosmetic fixes, reconcile with DMF branch Signed-off-by: Jim Klimov --- tools/nut-scanner/scan_snmp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/nut-scanner/scan_snmp.c b/tools/nut-scanner/scan_snmp.c index 13def273b6..c2f09e7d51 100644 --- a/tools/nut-scanner/scan_snmp.c +++ b/tools/nut-scanner/scan_snmp.c @@ -21,6 +21,7 @@ /*! \file scan_snmp.c \brief detect NUT supported SNMP devices \author Frederic Bohe + \author Jim Klimov \author Arnaud Quette \author Jim Klimov */ @@ -1111,15 +1112,13 @@ nutscan_device_t * nutscan_scan_ip_range_snmp(nutscan_ip_range_list_t * irl, sem_t semaphore_scantype_inst; sem_t * semaphore_scantype = &semaphore_scantype_inst; # endif /* HAVE_SEMAPHORE */ - pthread_t thread; + pthread_t thread; nutscan_thread_t * thread_array = NULL; size_t thread_count = 0, i; # if (defined HAVE_PTHREAD_TRYJOIN) || (defined HAVE_SEMAPHORE) size_t max_threads_scantype = max_threads_netsnmp; # endif -#endif /* HAVE_PTHREAD */ -#ifdef HAVE_PTHREAD pthread_mutex_init(&dev_mutex, NULL); # ifdef HAVE_SEMAPHORE @@ -1186,6 +1185,7 @@ nutscan_device_t * nutscan_scan_ip_range_snmp(nutscan_ip_range_list_t * irl, upsdebugx(1, "Failed to enable numeric OIDs resolution"); } + /* Initialize the SNMP library */ init_snmp_once(); ip_str = nutscan_ip_ranges_iter_init(&ip, irl);