components/net-snmp/patches/016.6934478.vmstat_solaris2.patch
author Stacey Marshall <Stacey.Marshall@Oracle.COM>
Tue, 22 Apr 2014 11:07:09 +0100
branchs11u1-sru
changeset 3101 3855f970a9cc
parent 252 ee0fb1eabcbf
permissions -rw-r--r--
18452930 Upgrade Solaris to BIND 9.6-ESV-R11 15609922 SUNBT6909705 BIND 9.6.x test T:dst:2:a fails as of onnv_119 18390583 problem in SERVICE/DNS-SERVER

--- patch/net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c	Tue Oct 12 07:37:07 2010
+++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/vmstat_solaris2.c	Tue Oct 12 07:34:41 2010
@@ -709,7 +709,12 @@
     case CPUIDLE:
         return ((u_char *) (&cpu_perc[CPU_IDLE]));
     case CPURAWUSER:
-        take_snapshot(&raw_values);
+	/* Take the current snapshot */
+	if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) {
+		snmp_log(LOG_WARNING,
+		    "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n");
+		return (NULL);
+	}
         /*
          * LINTED has to be 'long' 
          */
@@ -723,7 +728,12 @@
          * (Has been changed to Counter32 in the latest MIB version!) 
          */
     case CPURAWSYSTEM:
-        take_snapshot(&raw_values);
+	/* Take the current snapshot */
+	if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) {
+		snmp_log(LOG_WARNING,
+		    "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n");
+		return (NULL);
+	}
         /*
          * LINTED has to be 'long' 
          */
@@ -732,7 +742,12 @@
                      raw_values.css_cpu[CPU_WAIT]) / raw_values.css_cpus);
         return ((u_char *) (&long_ret));
     case CPURAWIDLE:
-        take_snapshot(&raw_values);
+	/* Take the current snapshot */
+	if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) {
+		snmp_log(LOG_WARNING,
+		    "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n");
+		return (NULL);
+	}
         /*
          * LINTED has to be 'long' 
          */
@@ -740,7 +755,12 @@
             (long) (raw_values.css_cpu[CPU_IDLE] / raw_values.css_cpus);
         return ((u_char *) (&long_ret));
     case CPURAWWAIT:
-        take_snapshot(&raw_values);
+	/* Take the current snapshot */
+	if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) {
+		snmp_log(LOG_WARNING,
+		    "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n");
+		return (NULL);
+	}
         /*
          * LINTED has to be 'long' 
          */
@@ -748,7 +768,12 @@
             (long) (raw_values.css_cpu[CPU_WAIT] / raw_values.css_cpus);
         return ((u_char *) (&long_ret));
     case CPURAWKERNEL:
-        take_snapshot(&raw_values);
+	/* Take the current snapshot */
+	if ((take_snapshot(&raw_values) == -1) && (raw_values.css_cpus == 0)) {
+		snmp_log(LOG_WARNING,
+		    "vmstat_solaris2 (var_extensible_vmstat): Something went wrong with take_snapshot.\n");
+		return (NULL);
+	}
         /*
          * LINTED has to be 'long' 
          */