aboutsummaryrefslogtreecommitdiff
path: root/net/net-snmp4
diff options
context:
space:
mode:
authorJun Kuriyama <kuriyama@FreeBSD.org>2002-08-29 03:22:59 +0000
committerJun Kuriyama <kuriyama@FreeBSD.org>2002-08-29 03:22:59 +0000
commit172020bf74f63435858141e14217cb8873bff5c5 (patch)
treef93dc0ba93e020856873e573faaa36a5f7e69fda /net/net-snmp4
parentd6b758dc0bd36df4296dc11deb1e1f06ea0942da (diff)
downloadports-172020bf74f63435858141e14217cb8873bff5c5.tar.gz
ports-172020bf74f63435858141e14217cb8873bff5c5.zip
Notes
Diffstat (limited to 'net/net-snmp4')
-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));