mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-27 00:57:50 +00:00
Add a patch to show enterprises.ucdavis.dskTable.dskEntry.dskPercentNode
mibs on our system. Submitted by: Donal Diamond <donal.diamond@eircom.net>
This commit is contained in:
parent
d6b758dc0b
commit
172020bf74
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=65210
@ -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/ \
|
||||
|
32
net-mgmt/net-snmp4/files/patch-disk.c
Normal file
32
net-mgmt/net-snmp4/files/patch-disk.c
Normal file
@ -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));
|
@ -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/ \
|
||||
|
32
net/net-snmp4/files/patch-disk.c
Normal file
32
net/net-snmp4/files/patch-disk.c
Normal file
@ -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));
|
Loading…
Reference in New Issue
Block a user