summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2002-11-01 23:52:14 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2002-11-01 23:52:14 +0000
commitc8f47f1b97ad361f2e6b387e30d914ec9642e096 (patch)
treefe4f804c1df2edc8b968fd71393dd7c43f133c1a
parentFix the path to the patched file. (diff)
Backport the kernel memory dereference patch from libgtop2.
-rw-r--r--devel/libgtop/Makefile2
-rw-r--r--devel/libgtop/files/patch-ah28
2 files changed, 15 insertions, 15 deletions
diff --git a/devel/libgtop/Makefile b/devel/libgtop/Makefile
index 92e36a0d8ab2..2626a4eb9bea 100644
--- a/devel/libgtop/Makefile
+++ b/devel/libgtop/Makefile
@@ -7,7 +7,7 @@
PORTNAME= libgtop
PORTVERSION= 1.0.13
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= devel gnome
MASTER_SITES= ${MASTER_SITE_GNOME}
MASTER_SITE_SUBDIR= sources/libgtop/1.0
diff --git a/devel/libgtop/files/patch-ah b/devel/libgtop/files/patch-ah
index 8b51deb9adda..db7894c05f9e 100644
--- a/devel/libgtop/files/patch-ah
+++ b/devel/libgtop/files/patch-ah
@@ -1,5 +1,5 @@
--- sysdeps/freebsd/procmap.c.orig Mon Nov 26 17:37:59 2001
-+++ sysdeps/freebsd/procmap.c Sat Oct 19 14:07:46 2002
++++ sysdeps/freebsd/procmap.c Fri Nov 1 18:48:52 2002
@@ -33,7 +33,11 @@
#include <sys/proc.h>
#include <sys/resource.h>
@@ -12,15 +12,18 @@
#include <vm/vm_map.h>
#include <sys/vnode.h>
-@@ -92,7 +96,6 @@
+@@ -91,8 +95,9 @@
+ glibtop_map_entry *maps;
#if defined __FreeBSD__
struct vnode vnode;
++#if __FreeBSD_version < 50039
struct inode inode;
- struct mount mount;
++#endif
#endif
int count, i = 0;
int update = 0;
-@@ -114,7 +117,11 @@
+@@ -114,7 +119,11 @@
/* Now we get the memory maps. */
if (kvm_read (server->machine.kd,
@@ -32,21 +35,18 @@
(char *) &vmspace, sizeof (vmspace)) != sizeof (vmspace))
glibtop_error_io_r (server, "kvm_read (vmspace)");
-@@ -217,7 +224,7 @@
- if (!vnode.v_uvm.u_flags & UVM_VNODE_VALID)
- continue;
-
-- if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
-+ if ((vnode.v_type != VREG) || strcmp("ufs", vnode.v_tag) ||
- !vnode.v_data) continue;
-
- if (kvm_read (server->machine.kd,
-@@ -244,18 +251,17 @@
+@@ -244,18 +253,23 @@
&vnode, sizeof (vnode)) != sizeof (vnode))
glibtop_error_io_r (server, "kvm_read (vnode)");
+#if __FreeBSD_version >= 500039
-+ if ((vnode.v_type != VREG) || strcmp("ufs", vnode.v_tag) ||
++ switch (vnode.v_type) {
++ case VREG:
++ maps [i-1].inode = vnode.v_cachedid;
++ maps [i-1].device = vnode.v_cachedfs;
++ default:
++ continue;
++ }
+#else
if ((vnode.v_type != VREG) || (vnode.v_tag != VT_UFS) ||
+#endif