aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorkuriyama <kuriyama@FreeBSD.org>2002-08-29 11:22:59 +0800
committerkuriyama <kuriyama@FreeBSD.org>2002-08-29 11:22:59 +0800
commit6c8d61785e4a73d65638ed1256dbafae576ca856 (patch)
tree7045e6ac740e0b861a685bddcbd19b0b8e044074 /net
parent1c85d553da14d394f01a2d1a3866a3cf7a50564a (diff)
downloadfreebsd-ports-gnome-6c8d61785e4a73d65638ed1256dbafae576ca856.tar.gz
freebsd-ports-gnome-6c8d61785e4a73d65638ed1256dbafae576ca856.tar.zst
freebsd-ports-gnome-6c8d61785e4a73d65638ed1256dbafae576ca856.zip
Add a patch to show enterprises.ucdavis.dskTable.dskEntry.dskPercentNode
mibs on our system. Submitted by: Donal Diamond <donal.diamond@eircom.net>
Diffstat (limited to 'net')
-rw-r--r--net/net-snmp4/Makefile2
-rw-r--r--net/net-snmp4/files/patch-disk.c32
2 files changed, 33 insertions, 1 deletions
diff --git a/net/net-snmp4/Makefile b/net/net-snmp4/Makefile
index 90ecbacaf6da..2c183f3c5ae5 100644
--- a/net/net-snmp4/Makefile
+++ b/net/net-snmp4/Makefile
@@ -7,7 +7,7 @@
PORTNAME= ucd-snmp
PORTVERSION= 4.2.5
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= net ipv6
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \
ftp://ucd-snmp.ucdavis.edu/ \
diff --git a/net/net-snmp4/files/patch-disk.c b/net/net-snmp4/files/patch-disk.c
new file mode 100644
index 000000000000..5d82a33941bc
--- /dev/null
+++ b/net/net-snmp4/files/patch-disk.c
@@ -0,0 +1,32 @@
+--- agent/mibgroup/ucd-snmp/disk.c.orig Wed Apr 3 07:57:57 2002
++++ agent/mibgroup/ucd-snmp/disk.c Thu Aug 29 12:11:17 2002
+@@ -340,7 +340,7 @@
+ double totalblks, free, used, avail, availblks;
+ #else
+ static long avail;
+-#ifdef STRUCT_STATVFS_HAS_F_FILES
++#if defined(HAVE_UFS_FFS_FS_H) || defined(STRUCT_STATVFS_HAS_F_FILES)
+ int percent_inode;
+ #endif
+ #endif
+@@ -424,6 +424,11 @@
+ (int) ((double) (vfs.f_files - vfs.f_ffree) /
+ (double) (vfs.f_files - (vfs.f_ffree - vfs.f_favail)) * 100.0 + 0.5);
+ #endif
++#if defined(HAVE_UFS_FFS_FS_H) && !defined(STRUCT_STATVFS_HAS_F_FILES)
++ percent_inode = vfs.f_files == 0 ? 100.0 :
++ (int) ((double) (vfs.f_files - vfs.f_ffree) /
++ (double) (vfs.f_files) * 100.0 + 0.5);
++#endif
+ switch (vp->magic) {
+ case DISKTOTAL:
+ long_ret = vfs.f_blocks * (vfs.f_bsize / 1024);
+@@ -444,7 +449,7 @@
+ case DISKPERCENT:
+ long_ret = percent;
+ return ((u_char *) (&long_ret));
+-#ifdef STRUCT_STATVFS_HAS_F_FILES
++#if defined(HAVE_UFS_FFS_FS_H) || defined(STRUCT_STATVFS_HAS_F_FILES)
+ case DISKPERCENTNODE:
+ long_ret = percent_inode;
+ return ((u_char *) (&long_ret));