aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authormarcus <marcus@FreeBSD.org>2003-03-29 02:30:18 +0800
committermarcus <marcus@FreeBSD.org>2003-03-29 02:30:18 +0800
commit9078a69f26e83bb780d720cdea0b69bbe39873f8 (patch)
tree67ebfd63f87133ebe9682e898c1c36f4665874de /net-mgmt
parentefafcc4d17627065e9329b61526a3d3a265ef693 (diff)
downloadfreebsd-ports-gnome-9078a69f26e83bb780d720cdea0b69bbe39873f8.tar.gz
freebsd-ports-gnome-9078a69f26e83bb780d720cdea0b69bbe39873f8.tar.zst
freebsd-ports-gnome-9078a69f26e83bb780d720cdea0b69bbe39873f8.zip
Fix build on recent -CURRENT.
Reported by: Roar Pettersen <edprp@it.uib.no>
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c59
-rw-r--r--net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c17
-rw-r--r--net-mgmt/net-snmp4/files/patch-memory_freebsd2.c16
3 files changed, 89 insertions, 3 deletions
diff --git a/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c
new file mode 100644
index 000000000000..e41c70389805
--- /dev/null
+++ b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_diskio.c
@@ -0,0 +1,59 @@
+--- agent/mibgroup/ucd-snmp/diskio.c.orig Fri Mar 28 12:58:32 2003
++++ agent/mibgroup/ucd-snmp/diskio.c Fri Mar 28 13:21:04 2003
+@@ -47,7 +47,11 @@
+ #endif /* bsdi */
+
+ #if defined (freebsd4) || defined(freebsd5)
++#include <sys/param.h>
++#if __FreeBSD_version < 500101
+ #include <sys/dkstat.h>
++#endif
++#include <sys/resource.h>
+ #include <devstat.h>
+ #endif /* freebsd */
+
+@@ -318,7 +322,11 @@
+ }
+ memset(stat->dinfo, 0, sizeof(struct devinfo));
+
++#if __FreeBSD_version > 500106
++ if ((devstat_getdevs(NULL, stat)) == -1){
++#else
+ if ((getdevs(stat)) == -1){
++#endif
+ fprintf (stderr,"Can't get devices:%s\n", devstat_errbuf);
+ return 1;
+ }
+@@ -370,16 +378,32 @@
+ *var_len = strlen(stat->dinfo->devices[indx].device_name);
+ return (u_char *) stat->dinfo->devices[indx].device_name;
+ case DISKIO_NREAD:
++#if __FreeBSD_version > 500106
++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_READ];
++#else
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes_read;
++#endif
+ return (u_char *) & long_ret;
+ case DISKIO_NWRITTEN:
++#if __FreeBSD_version > 500106
++ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DSM_TOTAL_BYTES_WRITE];
++#else
+ long_ret = (signed long) stat->dinfo->devices[indx].bytes_written;
++#endif
+ return (u_char *) & long_ret;
+ case DISKIO_READS:
++#if __FreeBSD_version > 500106
++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_READ];
++#else
+ long_ret = (signed long) stat->dinfo->devices[indx].num_reads;
++#endif
+ return (u_char *) & long_ret;
+ case DISKIO_WRITES:
++#if __FreeBSD_version > 500106
++ long_ret = (signed long) stat->dinfo->devices[indx].operations[DSM_TOTAL_TRANSFERS_WRITE];
++#else
+ long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
++#endif
+ return (u_char *) & long_ret;
+
+ default:
diff --git a/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c
new file mode 100644
index 000000000000..15b1b69390ab
--- /dev/null
+++ b/net-mgmt/net-snmp4/files/patch-agent_mibgroup_ucd-snmp_vmstat_freebsd2.c
@@ -0,0 +1,17 @@
+--- agent/mibgroup/ucd-snmp/vmstat_freebsd2.c.orig Fri Mar 28 13:15:48 2003
++++ agent/mibgroup/ucd-snmp/vmstat_freebsd2.c Fri Mar 28 13:16:31 2003
+@@ -8,11 +8,14 @@
+ #include <sys/param.h>
+ #include <sys/time.h>
+ #include <sys/proc.h>
++#if __FreeBSD_version < 500101
+ #include <sys/dkstat.h>
++#endif
+ #ifdef freebsd5
+ #include <sys/bio.h>
+ #endif
+ #include <sys/buf.h>
++#include <sys/resource.h>
+ #include <sys/uio.h>
+ #include <sys/namei.h>
+ #include <sys/malloc.h>
diff --git a/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c b/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c
index e06a3266f224..e49eb0d77c01 100644
--- a/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c
+++ b/net-mgmt/net-snmp4/files/patch-memory_freebsd2.c
@@ -1,6 +1,16 @@
---- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Mon Sep 17 06:16:16 2001
-+++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Mon Mar 4 10:00:56 2002
-@@ -232,7 +232,7 @@
+--- agent/mibgroup/ucd-snmp/memory_freebsd2.c.orig Sun Sep 16 17:16:16 2001
++++ agent/mibgroup/ucd-snmp/memory_freebsd2.c Fri Mar 28 13:18:19 2003
+@@ -9,7 +9,9 @@
+ #include <sys/param.h>
+ #include <sys/time.h>
+ #include <sys/proc.h>
++#if __FreeBSD_version < 500101
+ #include <sys/dkstat.h>
++#endif
+ #ifdef freebsd5
+ #include <sys/bio.h>
+ #endif
+@@ -232,7 +234,7 @@
size_t total_size = sizeof (total);
int total_mib[] = { CTL_VM, VM_METER };