net-snmp-5.7.3-iterator-fix.patch 713 B

123456789101112131415
  1. diff -urNp old/agent/mibgroup/host/data_access/swrun.c new/agent/mibgroup/host/data_access/swrun.c
  2. --- old/agent/mibgroup/host/data_access/swrun.c 2017-07-18 09:44:00.626109526 +0200
  3. +++ new/agent/mibgroup/host/data_access/swrun.c 2017-07-19 15:27:50.452255836 +0200
  4. @@ -102,6 +102,10 @@ swrun_count_processes_by_name( char *nam
  5. return 0; /* or -1 */
  6. it = CONTAINER_ITERATOR( swrun_container );
  7. + if((entry = (netsnmp_swrun_entry*)ITERATOR_FIRST( it )) != NULL) {
  8. + if (0 == strcmp( entry->hrSWRunName, name ))
  9. + i++;
  10. + }
  11. while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
  12. if (0 == strcmp( entry->hrSWRunName, name ))
  13. i++;