Date: Sun, 29 Oct 2000 19:04:12 +0900 From: takahashi ryoji <ryoji@safins.ne.jp> To: "freebsd-bugs@FreeBSD.ORG" <freebsd-bugs@FreeBSD.ORG> Subject: [PATCH] ports/net/ucd-snmp Message-ID: <20001029190410.9DAE.RYOJI@safins.ne.jp>
next in thread | raw e-mail | index | archive | help
Synopsis: [PATCH] ports/net/ucd-snmp
Category: ports
Class: change-request
Confidential: no
Severity: non-critical
Priority: low
Release: FreeBSD 4.1-RELEASE i386
Description:
The value of
enterprises.ucdavis.memory.memTotalSwap.0
and
enterprises.ucdavis.memory.memAvailSwap.0
is indicated in 1/4.
Fix:
/usr/ports/net/ucd-snmp/work/ucd-snmp-4.1.2/agent/mibgroup/ucd-snmp
diff -rNu memory_freebsd2.c.old memory_freebsd2.c
--- memory_freebsd2.c.old Sun Oct 29 13:20:28 2000
+++ memory_freebsd2.c Sun Oct 29 16:15:11 2000
@@ -151,6 +151,7 @@
char *header;
int hlen, nswdev, dmmax;
int i, idiv, n;
+ int pagesize = getpagesize();
struct swdevt *sw;
long blocksize;
static kvm_t *kd = NULL;
@@ -188,13 +189,10 @@
/* Convert to kb */
header = getbsize(&hlen, &blocksize);
- idiv = blocksize / 512;
- if (idiv > 0) {
- swapTotal /= idiv;
- swapUsed /= idiv;
- swapFree /= idiv;
- }
+ swapTotal = swapTotal * pagesize / blocksize;
+ swapUsed = swapUsed * pagesize / blocksize;
+ swapFree = swapFree * pagesize / blocksize;
free(sw);
}
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001029190410.9DAE.RYOJI>
