components/net-snmp/patches/015.6956251.vmstat_solaris2.patch
author Milan Jurik <Milan.Jurik@oracle.com>
Wed, 30 Nov 2011 06:39:13 -0800
changeset 604 c25824a87b1f
parent 252 ee0fb1eabcbf
permissions -rw-r--r--
6674902 a lot of superfluous calls to clock_gettime if timed events is not used 6867692 libevent version needs to be updated to 1.4

--- patch/net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c	Tue Aug  3 06:04:52 2010
+++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c	Wed Oct  6 01:27:48 2010
@@ -589,6 +589,13 @@
             cpu_sum += (css_new->css_cpu[i] - css_old->css_cpu[i]);
         }
 
+	/*
+	 * Assign a minimum value to get around divide by zero case
+	 */
+	if (cpu_sum == 0) {
+		cpu_sum = 1;
+	}
+
         /*
          * Now calculate the absolute percentage values 
          * Looks somewhat complicated sometimes but tries to get around using floats to increase speed