aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils/xosview
diff options
context:
space:
mode:
authorclsung <clsung@FreeBSD.org>2006-01-27 16:17:32 +0800
committerclsung <clsung@FreeBSD.org>2006-01-27 16:17:32 +0800
commit3d7be32986cc7df71d1c5d90f46c2888f05a571f (patch)
tree7a3bd451c1468cbc8f1ac1ce1208aa0fe89a3d28 /sysutils/xosview
parente4527105eec0f47ddec092be3b075682fd1e1b36 (diff)
downloadfreebsd-ports-gnome-3d7be32986cc7df71d1c5d90f46c2888f05a571f.tar.gz
freebsd-ports-gnome-3d7be32986cc7df71d1c5d90f46c2888f05a571f.tar.zst
freebsd-ports-gnome-3d7be32986cc7df71d1c5d90f46c2888f05a571f.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>
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;