From owner-svn-ports-head@freebsd.org Sun Mar 8 02:55:06 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B4A9025B405; Sun, 8 Mar 2020 02:55:06 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48ZmDT43xTz4XMX; Sun, 8 Mar 2020 02:55:05 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 67BA31B3AA; Sun, 8 Mar 2020 02:55:05 +0000 (UTC) (envelope-from ler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0282t5gg045199; Sun, 8 Mar 2020 02:55:05 GMT (envelope-from ler@FreeBSD.org) Received: (from ler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0282t5WK045197; Sun, 8 Mar 2020 02:55:05 GMT (envelope-from ler@FreeBSD.org) Message-Id: <202003080255.0282t5WK045197@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ler set sender to ler@FreeBSD.org using -f From: Larry Rosenman Date: Sun, 8 Mar 2020 02:55:05 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r527995 - in head/sysutils/lsof: . files X-SVN-Group: ports-head X-SVN-Commit-Author: ler X-SVN-Commit-Paths: in head/sysutils/lsof: . files X-SVN-Commit-Revision: 527995 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Mar 2020 02:55:06 -0000 Author: ler Date: Sun Mar 8 02:55:04 2020 New Revision: 527995 URL: https://svnweb.freebsd.org/changeset/ports/527995 Log: sysutils/lsof: fix compile on 13-CURRENT Submitted by: mjg Modified: head/sysutils/lsof/Makefile head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c Modified: head/sysutils/lsof/Makefile ============================================================================== --- head/sysutils/lsof/Makefile Sun Mar 8 02:37:32 2020 (r527994) +++ head/sysutils/lsof/Makefile Sun Mar 8 02:55:04 2020 (r527995) @@ -6,7 +6,7 @@ PORTNAME= lsof DISTVERSION= 4.93.2 -PORTREVISION= 9 +PORTREVISION= 10 PORTEPOCH= 8 CATEGORIES= sysutils Modified: head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c ============================================================================== --- head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c Sun Mar 8 02:37:32 2020 (r527994) +++ head/sysutils/lsof/files/patch-dialects_freebsd_dproc.c Sun Mar 8 02:55:04 2020 (r527995) @@ -1,6 +1,98 @@ --- dialects/freebsd/dproc.c.orig 2019-05-08 07:32:25 UTC +++ dialects/freebsd/dproc.c -@@ -655,7 +655,29 @@ kread(addr, buf, len) +@@ -37,6 +37,14 @@ static char *rcsid = "$Id: dproc.c,v 1.20 2018/02/14 1 + + #include "lsof.h" + ++/* ++ * This is not an exact version but it should not matter. At worst there ++ * is a small version window where this lsof does not compile on older ++ * -CURRENT. ++ */ ++#if __FreeBSD_version >= 1300081 ++#define HAS_PWD ++#endif + + _PROTOTYPE(static void enter_vn_text,(KA_T va, int *n)); + _PROTOTYPE(static void get_kernel_access,(void)); +@@ -132,6 +140,15 @@ gather_proc_info() + KA_T fa; + #endif /* defined(HAS_FDESCENTTBL) */ + ++#if defined(HAS_PWD) ++ struct pwd pwd; ++ KA_T pwd_addr; ++#endif /* defined(HAS_FDESCENTTBL) */ ++ ++ struct vnode *cdir; ++ struct vnode *rdir; ++ struct vnode *jdir; ++ + static ofb_t *ofb = NULL; + static int ofbb = 0; + int pgid, pid; +@@ -312,6 +329,22 @@ gather_proc_info() + continue; + #endif /* defined(HAS_FDESCENTTBL) */ + ++#if defined(HAS_PWD) ++ cdir = rdir = jdir = NULL; ++ pwd_addr = (KA_T)FILEDESC_KVM_LOAD_PWD(&fd); ++ if (pwd_addr != 0) { ++ if (!kread(pwd_addr, (char *)&pwd, sizeof(pwd))) { ++ cdir = pwd.pwd_cdir; ++ rdir = pwd.pwd_rdir; ++ jdir = pwd.pwd_jdir; ++ } ++ } ++#else ++ cdir = fd.fd_cdir; ++ rdir = fd.fd_rdir; ++ jdir = fd.fd_jdir; ++#endif ++ + /* + * Allocate a local process structure. + */ +@@ -347,20 +380,20 @@ gather_proc_info() + /* + * Save current working directory information. + */ +- if (!ckscko && fd.fd_cdir) { ++ if (!ckscko && cdir) { + alloc_lfile(CWD, -1); + Cfp = (struct file *)NULL; +- process_node((KA_T)fd.fd_cdir); ++ process_node((KA_T)cdir); + if (Lf->sf) + link_lfile(); + } + /* + * Save root directory information. + */ +- if (!ckscko && fd.fd_rdir) { ++ if (!ckscko && rdir) { + alloc_lfile(RTD, -1); + Cfp = (struct file *)NULL; +- process_node((KA_T)fd.fd_rdir); ++ process_node((KA_T)rdir); + if (Lf->sf) + link_lfile(); + } +@@ -369,10 +402,10 @@ gather_proc_info() + /* + * Save jail directory information. + */ +- if (!ckscko && fd.fd_jdir) { ++ if (!ckscko && jdir) { + alloc_lfile("jld", -1); + Cfp = (struct file *)NULL; +- process_node((KA_T)fd.fd_jdir); ++ process_node((KA_T)jdir); + if (Lf->sf) + link_lfile(); + } +@@ -655,7 +688,29 @@ kread(addr, buf, len) return((br == len) ? 0 : 1); } @@ -30,7 +122,7 @@ /* * process_text() - process text information */ -@@ -682,20 +704,15 @@ process_text(vm) +@@ -682,20 +737,15 @@ process_text(vm) /* * Read the vm_map structure. Search its vm_map_entry structure list. */