diff options
author | Jun Kuriyama <kuriyama@FreeBSD.org> | 2002-08-29 02:21:28 +0000 |
---|---|---|
committer | Jun Kuriyama <kuriyama@FreeBSD.org> | 2002-08-29 02:21:28 +0000 |
commit | 16770abd78df7e975310baf918ebb1287c4c518f (patch) | |
tree | 0b4874323220763fd665d0a71897ef8dd29bff78 /net | |
parent | o Deploy USE_GNOMENG infrastrcuture (diff) |
Add a patch to show enterprises.ucdavis.dskTable.dskEntry.dskPercentNode
mibs on our system.
Submitted by: Donal Diamond <donal.diamond@eircom.net>
Notes
Notes:
svn path=/head/; revision=65204
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)); |