diff options
author | kuriyama <kuriyama@FreeBSD.org> | 2002-08-29 10:21:28 +0800 |
---|---|---|
committer | kuriyama <kuriyama@FreeBSD.org> | 2002-08-29 10:21:28 +0800 |
commit | cb4b77ae207255c058deed179171be5ba9e0c231 (patch) | |
tree | 14b7de334ffeac6877f05750ecf299c67a4eca9a /net | |
parent | 36146e589fa3df615cf11bc06eacb7bc070c1ee7 (diff) | |
download | freebsd-ports-gnome-cb4b77ae207255c058deed179171be5ba9e0c231.tar.gz freebsd-ports-gnome-cb4b77ae207255c058deed179171be5ba9e0c231.tar.zst freebsd-ports-gnome-cb4b77ae207255c058deed179171be5ba9e0c231.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-snmp/Makefile | 1 | ||||
-rw-r--r-- | net/net-snmp/files/patch-disk.c | 32 |
2 files changed, 33 insertions, 0 deletions
diff --git a/net/net-snmp/Makefile b/net/net-snmp/Makefile index 940b2eceb6c7..3591319a53cd 100644 --- a/net/net-snmp/Makefile +++ b/net/net-snmp/Makefile @@ -7,6 +7,7 @@ PORTNAME= net-snmp PORTVERSION= 5.0.3 +PORTREVISION= 1 CATEGORIES= net ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} \ ftp://sunsite.cnlab-switch.ch/mirror/ucd-snmp/ \ diff --git a/net/net-snmp/files/patch-disk.c b/net/net-snmp/files/patch-disk.c new file mode 100644 index 000000000000..ee6603a94e2a --- /dev/null +++ b/net/net-snmp/files/patch-disk.c @@ -0,0 +1,32 @@ +--- agent/mibgroup/ucd-snmp/disk.c.orig Mon Jul 8 11:37:20 2002 ++++ agent/mibgroup/ucd-snmp/disk.c Thu Aug 29 11:08:39 2002 +@@ -366,7 +366,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 +@@ -454,6 +454,11 @@ + (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); +@@ -475,7 +480,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)); |