net-snmp/net-snmp-5.7.3-iterator-fix.patch

15 lines
709 B
Diff
Raw Normal View History

2018-02-08 11:20:22 +00:00
diff -urNp old/agent/mibgroup/host/data_access/swrun.c new/agent/mibgroup/host/data_access/swrun.c
2018-03-27 08:55:06 +00:00
--- old/agent/mibgroup/host/data_access/swrun.c 2018-03-26 09:00:39.932335587 +0200
+++ new/agent/mibgroup/host/data_access/swrun.c 2018-03-26 09:03:00.845876681 +0200
@@ -102,7 +102,9 @@ swrun_count_processes_by_name( char *nam
2018-02-08 11:20:22 +00:00
return 0; /* or -1 */
it = CONTAINER_ITERATOR( swrun_container );
2018-03-27 08:55:06 +00:00
- while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
+ for (entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it );
+ entry;
+ entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) {
2018-02-08 11:20:22 +00:00
if (0 == strcmp( entry->hrSWRunName, name ))
i++;
2018-03-27 08:55:06 +00:00
}