aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xosview
diff options
context:
space:
mode:
authorCheng-Lung Sung <clsung@FreeBSD.org>2006-01-27 08:17:32 +0000
committerCheng-Lung Sung <clsung@FreeBSD.org>2006-01-27 08:17:32 +0000
commitef81a7a91c1dd0b833b407a3cf2b36320c0e8b2a (patch)
tree3057c9314c41d99687f9944c5a934008f9699ac8 /sysutils/xosview
parent09e0794723931d58e26afceb1cceac07444a79e0 (diff)
downloadports-ef81a7a91c1dd0b833b407a3cf2b36320c0e8b2a.tar.gz
ports-ef81a7a91c1dd0b833b407a3cf2b36320c0e8b2a.zip
- The sysutils/xosview port that comes with 6.0 results in a
memory leak that eventually crashes the xosview process. The CVS tree doesn't show any activity here more recent than 6.0. The attached extra patch to bsd/kernel.cc fixes the problem. - bump PORTREVISION PR: 92339 Submitted by: Tom Pavel <pavel AT alum dot mit dot edu>
Notes
Notes: svn path=/head/; revision=154570
Diffstat (limited to 'sysutils/xosview')
-rw-r--r--sysutils/xosview/Makefile1
-rw-r--r--sysutils/xosview/files/patch-kernel.cc18
2 files changed, 14 insertions, 5 deletions
diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile
index b5a631d853ba..b1ff44338179 100644
--- a/sysutils/xosview/Makefile
+++ b/sysutils/xosview/Makefile
@@ -8,6 +8,7 @@
PORTNAME= xosview
PORTVERSION= 1.8.2
+PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
diff --git a/sysutils/xosview/files/patch-kernel.cc b/sysutils/xosview/files/patch-kernel.cc
index 30ce4ca01d81..9a4ac74e9207 100644
--- a/sysutils/xosview/files/patch-kernel.cc
+++ b/sysutils/xosview/files/patch-kernel.cc
@@ -1,5 +1,5 @@
---- bsd/kernel.cc.orig Tue Oct 14 03:53:17 2003
-+++ bsd/kernel.cc Thu Mar 17 23:26:49 2005
+--- bsd/kernel.cc.orig Tue Oct 14 09:53:17 2003
++++ bsd/kernel.cc Fri Jan 27 16:02:27 2006
@@ -54,6 +54,7 @@
#endif
@@ -217,14 +217,14 @@
/* FreeBSD has an array of interrupt counts, indexed by device number.
These are also indirected by IRQ num with intr_countp: */
safe_kvm_read (nlst[INTRCOUNTP_SYM_INDEX].n_value,
-@@ -944,6 +1004,38 @@
+@@ -944,6 +1004,46 @@
sizeof(unsigned long);
intrCount[i] = kvm_intrcnt[idx];
}
+#else /* FreeBSD 5.x and 6.x */
+ /* This code is stolen from vmstat */
-+ unsigned long *kvm_intrcnt;
-+ char *kvm_intrname;
++ unsigned long *kvm_intrcnt, *base_intrcnt;
++ char *kvm_intrname, *base_intrname;
+ size_t inamlen, intrcntlen;
+ unsigned int i, nintr;
+ int d;
@@ -237,6 +237,10 @@
+ ((kvm_intrname = (char *)malloc(inamlen)) == NULL))
+ err(1, "malloc()");
+
++ // keep track of the mem we're given:
++ base_intrcnt = kvm_intrcnt;
++ base_intrname = kvm_intrname;
++
+ safe_kvm_read (nlst[INTRCNT_SYM_INDEX].n_value, kvm_intrcnt, intrcntlen);
+ safe_kvm_read (nlst[INTRNAMES_SYM_INDEX].n_value, kvm_intrname, inamlen);
+
@@ -252,6 +256,10 @@
+ kvm_intrcnt++;
+ kvm_intrname += strlen(kvm_intrname) + 1;
+ }
++
++ // Doh! somebody needs to free this stuff too... (pavel 20-Jan-2006)
++ free(base_intrcnt);
++ free(base_intrname);
+#endif
#elif defined (XOSVIEW_BSDI)
int nintr = 16;