pkgsrc/net/net-snmp/patches/patch-ag

61 lines
1.7 KiB
Text

$NetBSD: patch-ag,v 1.7 2006/03/19 22:03:29 joerg Exp $
--- agent/mibgroup/host/hr_storage.c.orig 2005-10-31 09:14:38.000000000 +0000
+++ agent/mibgroup/host/hr_storage.c
@@ -73,6 +73,13 @@
#endif
#endif /* vm/vm.h */
#endif /* sys/vm.h */
+#if HAVE_SYS_POOL_H
+#if defined(MBPOOL_SYMBOL) && defined(MCLPOOL_SYMBOL)
+#define __POOL_EXPOSE
+#include <sys/pool.h>
+#else
+#undef HAVE_SYS_POOL_H
+#endif
#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
#include <uvm/uvm_param.h>
#include <uvm/uvm_extern.h>
@@ -80,20 +87,13 @@
#include <vm/vm_param.h>
#include <vm/vm_extern.h>
#endif
+#endif
#if HAVE_KVM_H
#include <kvm.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#if HAVE_SYS_POOL_H
-#if defined(MBPOOL_SYMBOL) && defined(MCLPOOL_SYMBOL)
-#define __POOL_EXPOSE
-#include <sys/pool.h>
-#else
-#undef HAVE_SYS_POOL_H
-#endif
-#endif
#if HAVE_SYS_MBUF_H
#include <sys/mbuf.h>
#endif
@@ -732,11 +732,6 @@ really_try_next:
case HRS_TYPE_SWAP:
long_return = -1;
break;
-#if defined(MBSTAT_SYMBOL)
- case HRS_TYPE_MBUF:
- long_return = mbstat.m_mbufs;
- break;
-#endif
#elif defined(TOTAL_MEMORY_SYMBOL) || defined(USE_SYSCTL_VM)
case HRS_TYPE_MEM:
long_return = memory_totals.t_rm;
@@ -764,6 +759,8 @@ really_try_next:
case HRS_TYPE_MBUF:
#ifdef linux
long_return = linux_mem(store_idx, HRSTORE_SIZE);
+#elif defined(darwin8) && defined(MBSTAT_SYMBOL)
+ long_return = mbstat.m_mbufs;
#elif HAVE_SYS_POOL_H
long_return = 0;
for (i = 0;