Date: Sat, 21 Dec 2019 02:01:52 +0000 (UTC) From: Larry Rosenman <ler@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r520539 - in head/sysutils/lsof: . files Message-ID: <201912210201.xBL21qqR062542@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ler Date: Sat Dec 21 02:01:52 2019 New Revision: 520539 URL: https://svnweb.freebsd.org/changeset/ports/520539 Log: sysutils/lsof: unbreak after base r354895. - fix vm_map related breakage - remove #define/#undef _KERNEL for tmpfs (dougm had the header fixed) patch courtesy of dougm@ PR: 242620 Reported by: ish@amail.plala.or.jp Obtained from: dougm Added: head/sysutils/lsof/files/patch-dialects_freebsd_dnode.c (contents, props changed) head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c (contents, props changed) Modified: head/sysutils/lsof/Makefile Modified: head/sysutils/lsof/Makefile ============================================================================== --- head/sysutils/lsof/Makefile Sat Dec 21 01:13:07 2019 (r520538) +++ head/sysutils/lsof/Makefile Sat Dec 21 02:01:52 2019 (r520539) @@ -3,7 +3,7 @@ PORTNAME= lsof DISTVERSION= 4.93.2 -PORTREVISION= 5 +PORTREVISION= 6 PORTEPOCH= 8 CATEGORIES= sysutils Added: head/sysutils/lsof/files/patch-dialects_freebsd_dnode.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsof/files/patch-dialects_freebsd_dnode.c Sat Dec 21 02:01:52 2019 (r520539) @@ -0,0 +1,12 @@ +--- dialects/freebsd/dnode.c.orig 2019-12-19 21:29:42 UTC ++++ dialects/freebsd/dnode.c +@@ -58,9 +58,7 @@ _PROTOTYPE(static int lkup_dev_tty,(dev_t *dr, INODETY + + + #if defined(HAS_TMPFS) +-#define _KERNEL + #include <fs/tmpfs/tmpfs.h> +-#undef _KERNEL + #endif /* defined(HAS_TMPFS) */ + + _PROTOTYPE(static void get_lock_state,(KA_T f)); Added: head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c Sat Dec 21 02:01:52 2019 (r520539) @@ -0,0 +1,57 @@ +--- dialects/freebsd/dproc.c.orig 2019-05-08 07:32:25 UTC ++++ dialects/freebsd/dproc.c +@@ -655,7 +655,29 @@ kread(addr, buf, len) + return((br == len) ? 0 : 1); + } + ++static int ++vm_map_reader(void *token, vm_map_entry_t addr, vm_map_entry_t dest) ++{ ++ return (kread((KA_T)addr, (char *)dest, sizeof(*dest))); ++} + ++#if __FreeBSD_version < 1300060 ++typedef int vm_map_entry_reader(void *token, vm_map_entry_t addr, ++ vm_map_entry_t dest); ++ ++static inline vm_map_entry_t ++vm_map_entry_read_succ(void *token, struct vm_map_entry *const clone, ++ vm_map_entry_reader reader) ++{ ++ vm_map_entry_t next; ++ ++ next = clone->next; ++ if (!reader(token, next, clone)) ++ return (NULL); ++ return (next); ++} ++#endif /* __FreeBSD_version < 1300060 */ ++ + /* + * process_text() - process text information + */ +@@ -682,20 +704,15 @@ process_text(vm) + /* + * Read the vm_map structure. Search its vm_map_entry structure list. + */ ++ vmme = vmsp.vm_map.header; ++ e = &vmme; + for (i = 0; i < vmsp.vm_map.nentries; i++) { + + /* + * Read the next vm_map_entry. + */ +- if (i == 0) +- e = &vmsp.vm_map.header; +- else { +- if (!(ka = (KA_T)e->next)) +- return; +- e = &vmme; +- if (kread(ka, (char *)e, sizeof(vmme))) +- return; +- } ++ if (!vm_map_entry_read_succ(NULL, e, vm_map_reader)) ++ return; + + #if defined(MAP_ENTRY_IS_A_MAP) + if (e->eflags & (MAP_ENTRY_IS_A_MAP|MAP_ENTRY_IS_SUB_MAP))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912210201.xBL21qqR062542>