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 floating point exception on NetBSD/sp...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ab2e0f3d86fe
branches:  trunk
changeset: 537095:ab2e0f3d86fe
user:      seb <seb%pkgsrc.org@localhost>
date:      Thu Jan 03 19:10:09 2008 +0000

description:
Fix floating point exception on NetBSD/sparc64 by applying the same
fix (and error checking) on
agent/mibgroup/hardware/memory/memory_netbsd.c:netsnmp_mem_arch_load()
via new patch file patch-ah as the one applied on
agent/mibgroup/ucd-snmp/memory_netbsd1.c:var_extensible_mem() by
patch file patch-es. Sorry I missed this in november 2006...

Bump PKGREVISION to 1.

diffstat:

 net/net-snmp/Makefile         |   3 +-
 net/net-snmp/distinfo         |   3 +-
 net/net-snmp/patches/patch-ah |  48 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 2 deletions(-)

diffs (81 lines):

diff -r da9ebb4abacc -r ab2e0f3d86fe net/net-snmp/Makefile
--- a/net/net-snmp/Makefile     Thu Jan 03 18:18:30 2008 +0000
+++ b/net/net-snmp/Makefile     Thu Jan 03 19:10:09 2008 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.66 2007/11/23 21:29:17 adrianp Exp $
+# $NetBSD: Makefile,v 1.67 2008/01/03 19:10:09 seb Exp $
 
 DISTNAME=      net-snmp-5.4.1
+PKGREVISION=   1
 CATEGORIES=    net
 MASTER_SITES=  ${MASTER_SITE_SOURCEFORGE:=net-snmp/}
 
diff -r da9ebb4abacc -r ab2e0f3d86fe net/net-snmp/distinfo
--- a/net/net-snmp/distinfo     Thu Jan 03 18:18:30 2008 +0000
+++ b/net/net-snmp/distinfo     Thu Jan 03 19:10:09 2008 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.41 2007/08/12 13:36:37 joerg Exp $
+$NetBSD: distinfo,v 1.42 2008/01/03 19:10:09 seb Exp $
 
 SHA1 (net-snmp-5.4.1.tar.gz) = ac5ba033c10d53d3057415121f8c4936c643c208
 RMD160 (net-snmp-5.4.1.tar.gz) = 3723488dab8d164702a7d55c9c72eeaec07dd50c
@@ -9,6 +9,7 @@
 SHA1 (patch-ae) = 721e62bb42b6d3787f36316cf2628cd71ae6a6ce
 SHA1 (patch-af) = 88d0433a6a233dc52fec10e29183d820c50bd524
 SHA1 (patch-ag) = 7021f7238c37635c9c32ceca681fd42aa125437f
+SHA1 (patch-ah) = 9ad04b5c0046a82c4e601e4f3abb2dd491846489
 SHA1 (patch-al) = 2609e273d557e1ce06c1295d86965fe26ac7ff08
 SHA1 (patch-am) = 64461aef9b4409cd7ed4941e5d5441710a6035d8
 SHA1 (patch-an) = 167f23c62c085efc96a25bc2be5dca3c746dde6f
diff -r da9ebb4abacc -r ab2e0f3d86fe net/net-snmp/patches/patch-ah
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/net-snmp/patches/patch-ah     Thu Jan 03 19:10:09 2008 +0000
@@ -0,0 +1,48 @@
+$NetBSD: patch-ah,v 1.4 2008/01/03 19:10:10 seb Exp $
+
+--- agent/mibgroup/hardware/memory/memory_netbsd.c.orig        2006-03-06 16:23:52.000000000 +0000
++++ agent/mibgroup/hardware/memory/memory_netbsd.c
+@@ -4,6 +4,7 @@
+ #include <net-snmp/agent/hardware/memory.h>
+ 
+ #include <unistd.h>
++#include <errno.h>
+ #include <sys/sysctl.h>
+ #include <sys/swap.h>
+ 
+@@ -30,7 +31,7 @@ int netsnmp_mem_arch_load( netsnmp_cache
+     long           pagesize;
+ 
+     struct uvmexp  uvmexp;
+-    int            uvmexp_size  = sizeof(uvmexp);
++    size_t         uvmexp_size  = sizeof(uvmexp);
+     int            uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
+ 
+     struct vmtotal total;
+@@ -46,10 +47,22 @@ int netsnmp_mem_arch_load( netsnmp_cache
+     /*
+      * Retrieve the memory information from the underlying O/S...
+      */
+-    sysctl(uvmexp_mib,   2, &uvmexp,   &uvmexp_size,   NULL, 0);
+-    sysctl(total_mib,    2, &total,    &total_size,    NULL, 0);
+-    sysctl(phys_mem_mib, 2, &phys_mem, &mem_size,      NULL, 0);
+-    sysctl(user_mem_mib, 2, &user_mem, &mem_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 -1;
++    }
++    if (sysctl(total_mib,    2, &total,    &total_size,    NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl VM_METER failed (errno %d)\n", errno);
++      return -1;
++    }
++    if (sysctl(phys_mem_mib, 2, &phys_mem, &mem_size,      NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl HW_PHYSMEM failed (errno %d)\n", errno);
++      return -1;
++    }
++    if (sysctl(user_mem_mib, 2, &user_mem, &mem_size,      NULL, 0) == -1) {
++        snmp_log(LOG_ERR, "sysctl HW_USERMEM failed (errno %d)\n", errno);
++      return -1;
++    }
+     pagesize = uvmexp.pagesize;
+ 
+     /*



Home | Main Index | Thread Index | Old Index