pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/net-snmp Fix a NetBSD/sparc64 bug: give sysctl() a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/1934af456477
branches:  trunk
changeset: 519354:1934af456477
user:      seb <seb%pkgsrc.org@localhost>
date:      Mon Oct 02 00:09:55 2006 +0000

description:
Fix a NetBSD/sparc64 bug: give sysctl() a pointer on a size_t not on an int!
While here check for sysctl() return value.
Now snmpd on NetBSD/sparc64 should report more meaningful values
for OIDs like UCD-SNMP-MIB::memAvailReal.0.

Bump PKGREVISION.

diffstat:

 net/net-snmp/Makefile         |   3 ++-
 net/net-snmp/distinfo         |   3 ++-
 net/net-snmp/patches/patch-es |  39 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 2 deletions(-)

diffs (70 lines):

diff -r 14fc1fe45901 -r 1934af456477 net/net-snmp/Makefile
--- a/net/net-snmp/Makefile     Sun Oct 01 22:36:46 2006 +0000
+++ b/net/net-snmp/Makefile     Mon Oct 02 00:09:55 2006 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.53 2006/09/24 15:04:35 joerg Exp $
+# $NetBSD: Makefile,v 1.54 2006/10/02 00:09:55 seb Exp $
 
 DISTNAME=      net-snmp-5.3.1
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=net-snmp/} \
                ftp://ftp.net-smnp.org/pub/sourceforge/net-snmp/
diff -r 14fc1fe45901 -r 1934af456477 net/net-snmp/distinfo
--- a/net/net-snmp/distinfo     Sun Oct 01 22:36:46 2006 +0000
+++ b/net/net-snmp/distinfo     Mon Oct 02 00:09:55 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.31 2006/10/01 20:08:29 seb Exp $
+$NetBSD: distinfo,v 1.32 2006/10/02 00:09:55 seb Exp $
 
 SHA1 (net-snmp-5.3.1.tar.gz) = 8ddb5122769814f04a7d3d352dcc640df7c89d41
 RMD160 (net-snmp-5.3.1.tar.gz) = 7bcdd213fb2517d0927b030deab5146522b58b3d
@@ -50,4 +50,5 @@
 SHA1 (patch-ep) = 952e24044ad8a5fe370166d61c76c4760196365c
 SHA1 (patch-eq) = 52f831c88fd7d1f2153686bb5288f4f093a0f41f
 SHA1 (patch-er) = 1ca5658a6c97210174c83f63cc5791d02037541b
+SHA1 (patch-es) = c26c048ccbda7e4d28cb0a2263cdaa71befb4f96
 SHA1 (patch-mib2cupdate) = d6773633c8737fe45a58e378967995e21012d21d
diff -r 14fc1fe45901 -r 1934af456477 net/net-snmp/patches/patch-es
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/net-snmp/patches/patch-es     Mon Oct 02 00:09:55 2006 +0000
@@ -0,0 +1,39 @@
+$NetBSD: patch-es,v 1.1 2006/10/02 00:09:55 seb Exp $
+
+--- agent/mibgroup/ucd-snmp/memory_netbsd1.c.orig      2005-08-17 12:36:14.000000000 +0000
++++ agent/mibgroup/ucd-snmp/memory_netbsd1.c
+@@ -163,7 +163,7 @@ var_extensible_mem(struct variable *vp,
+     static char     errmsg[1024];
+ 
+     static struct uvmexp uvmexp;
+-    int             uvmexp_size = sizeof(uvmexp);
++    size_t          uvmexp_size = sizeof(uvmexp);
+     int             uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+     static struct vmtotal total;
+     size_t          total_size = sizeof(total);
+@@ -179,13 +179,22 @@ var_extensible_mem(struct variable *vp,
+     /*
+      * Memory info 
+      */
+-    sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0);
+-    sysctl(total_mib, 2, &total, &total_size, NULL, 0);
++    if (sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl VM_UVMEXP failed (errno %d)\n", errno);
++        return NULL;
++    }
++    if (sysctl(total_mib, 2, &total, &total_size, NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl VM_METER failed (errno %d)\n", errno);
++        return NULL;
++    }
+ 
+     /*
+      * Physical memory 
+      */
+-    sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
++    if (sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl HW_USERMEM failed (errno %d)\n", errno);
++        return NULL;
++    }
+ 
+     long_ret = 0;               /* set to 0 as default */
+ 



Home | Main Index | Thread Index | Old Index