summaryrefslogtreecommitdiff
path: root/sysutils/lsof
diff options
context:
space:
mode:
authoratatat <atatat@pkgsrc.org>2003-05-03 16:55:28 +0000
committeratatat <atatat@pkgsrc.org>2003-05-03 16:55:28 +0000
commit68b37f4439de74e926844fb6ef235db7cfb07394 (patch)
tree461b6621f0116f713b9b14ce50dc0c1f56cab564 /sysutils/lsof
parent568250dd7a4ad6e76e92fb59edfe2a28c388b9f2 (diff)
downloadpkgsrc-68b37f4439de74e926844fb6ef235db7cfb07394.tar.gz
Re-patch lsof with patches from Vic Abell. Building should now work
on all platforms, with ffs2 (and ext2fs) related bugs smoothed out. Bump to PKGREVISION 2.
Diffstat (limited to 'sysutils/lsof')
-rw-r--r--sysutils/lsof/Makefile3
-rw-r--r--sysutils/lsof/distinfo6
-rw-r--r--sysutils/lsof/patches/patch-ab258
-rw-r--r--sysutils/lsof/patches/patch-ac71
-rw-r--r--sysutils/lsof/patches/patch-ad151
5 files changed, 455 insertions, 34 deletions
diff --git a/sysutils/lsof/Makefile b/sysutils/lsof/Makefile
index fe536fd7bf0..8cc9e8d3662 100644
--- a/sysutils/lsof/Makefile
+++ b/sysutils/lsof/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.60 2003/04/10 20:10:20 grant Exp $
+# $NetBSD: Makefile,v 1.61 2003/05/03 16:55:28 atatat Exp $
#
DISTNAME= lsof_4.67
+PKGREVISION= 2
PKGNAME= ${DISTNAME:S/_/-/}
TMPWRK= ${WRKDIR}/${DISTNAME}
WRKSRC= ${WRKDIR}/${DISTNAME}/${SRCBALL_NAME}
diff --git a/sysutils/lsof/distinfo b/sysutils/lsof/distinfo
index 0225e840d5e..7a24f7a570b 100644
--- a/sysutils/lsof/distinfo
+++ b/sysutils/lsof/distinfo
@@ -1,6 +1,8 @@
-$NetBSD: distinfo,v 1.26 2003/04/19 02:09:09 christos Exp $
+$NetBSD: distinfo,v 1.27 2003/05/03 16:55:28 atatat Exp $
SHA1 (lsof_4.67.tar.gz) = bc6339455586e1dbb7e9b1b70af6f43ec12144f1
Size (lsof_4.67.tar.gz) = 959529 bytes
SHA1 (patch-aa) = 36790019394b4088c226222d4aefaec50430bcf3
-SHA1 (patch-ab) = a98b4e787816528b53b0bedf619732ecb3512cc3
+SHA1 (patch-ab) = dd3823ae58866885216993a1297ee8154943cabf
+SHA1 (patch-ac) = 1a8dd0ac9e6fe2613e356e1abc8702a920a63026
+SHA1 (patch-ad) = b44156ef6b2a5b586df2746101bbd22309a434ed
diff --git a/sysutils/lsof/patches/patch-ab b/sysutils/lsof/patches/patch-ab
index 047db072a7e..fda099a6ea5 100644
--- a/sysutils/lsof/patches/patch-ab
+++ b/sysutils/lsof/patches/patch-ab
@@ -1,49 +1,245 @@
-$NetBSD: patch-ab,v 1.19 2003/04/19 02:09:09 christos Exp $
+$NetBSD: patch-ab,v 1.20 2003/05/03 16:55:29 atatat Exp $
--- dialects/n+obsd/dnode.c.orig 2003-03-23 14:26:47.000000000 -0500
-+++ dialects/n+obsd/dnode.c 2003-04-18 22:02:42.000000000 -0400
-@@ -616,8 +616,18 @@
++++ dialects/n+obsd/dnode.c
+@@ -200,6 +200,22 @@ process_node(va)
+
+ #endif /* defined(HASFDESCFS) */
+
++#if defined(HASEXT2FS)
++# if defined(HASI_E2FS_PTR)
++ struct ext2fs_dinode ed;
++# endif /* defined(HASI_E2FS_PTR) */
++ struct ext2fs_dinode *edp = (struct ext2fs_dinode *)NULL;
++#endif /* defined(HASEXT2FS) */
++
++#if defined(HASI_FFS1)
++ unsigned char ffs = 0;
++ unsigned char u1s = 0;
++ unsigned char u2s = 0;
++ struct ufs1_dinode u1;
++ struct ufs2_dinode u2;
++ struct ufsmount um;
++#endif /* defined(HASI_FFS1) */
++
+ #if defined(HASKERNFS)
+ struct kernfs_node kn;
+ struct stat ksb;
+@@ -262,6 +278,14 @@ process_overlaid_node:
+ ksbs = 0;
+ #endif /* defined(HASKERNFS) */
+
++#if defined(HASEXT2FS)
++ edp = (struct ext2fs_dinode *)NULL;
++#endif /* defined(HASEXT2FS) */
++
++#if defined(HASI_FFS1)
++ ffs = u1s = u2s = 0;
++#endif /* defined(HASI_FFS1) */
++
+ /*
+ * Read the vnode.
+ */
+@@ -503,12 +527,51 @@ process_overlaid_node:
+ }
+
+ #if defined(HASEXT2FS)
+- if (v->v_tag == VT_EXT2FS)
++ if (v->v_tag == VT_EXT2FS) {
+ nty = EXT2NODE;
+- else
++
++# if defined(HASI_E2FS_PTR)
++ if (i.i_din.e2fs_din
++ && !kread((KA_T)i.i_din.e2fs_din, (char *)&ed, sizeof(ed)))
++ edp = &ed;
++# else /* !defined(HASI_E2FS_PTR) */
++ edp = &i.i_din.e2fs_din;
++# endif /* defined(HASI_E2FS_PTR) */
++
++ } else
+ #endif /* defined(HASEXT2FS) */
+
++ {
+ nty = INODE;
++
++#if defined(HASI_FFS1)
++ /*
++ * If there are multiple FFS's, read the relevant structures.
++ */
++ if (i.i_ump
++ && !kread((KA_T)i.i_ump, (char *)&um, sizeof(um))) {
++ if (um.um_fstype == UFS1) {
++ ffs = 1;
++ if (i.i_din.ffs1_din
++ && !kread((KA_T)i.i_din.ffs1_din, (char *)&u1,
++ sizeof(u1)))
++ {
++ u1s = 1;
++ }
++ } else if (um.um_fstype == UFS2) {
++ ffs = 2;
++ if (i.i_din.ffs2_din
++ && !kread((KA_T)i.i_din.ffs2_din, (char *)&u2,
++ sizeof(u2)))
++ {
++ u2s = 1;
++ }
++ }
++ }
++#endif /* defined(HASI_FFS1) */
++
++ }
++
+ if ((lff = i.i_lockf)) {
+
+ /*
+@@ -609,18 +672,21 @@ process_overlaid_node:
+ #if defined(HASEXT2FS)
+ case EXT2NODE:
+
+-# if defined(HASI_FFS)
+- dev = i.i_dev;
+- devs = 1;
+-# else /* !defined(HASI_FFS) */
dev = i.i_dev;
devs = 1;
if ((type == VCHR) || (type == VBLK)) {
-+#ifdef i_e2fs_rdev
-+ struct ext2fs_dinode din;
-+ if (i.i_din.e2fs_din &&
-+ !kread((KA_T)i.i_din.e2fs_din, (char *)&din, sizeof(din))) {
-+ rdev = din.e2di_rdev;
+- rdev = i.i_rdev;
++
++# if defined(HASI_E2FS_PTR)
++ if (edp) {
++ rdev = edp->e2di_rdev;
+ rdevs = 1;
-+ } else
-+ rdevs = 0;
-+#else
- rdev = i.i_rdev;
++ }
++# else /* !defined(HASI_E2FS_PTR) */
++ rdev = i.i_din.e2fs_din.e2di_rdev;
rdevs = 1;
-+#endif
- }
- # endif /* defined(HASI_FFS) */
+- }
+-# endif /* defined(HASI_FFS) */
++# endif /* defined(HASI_E2FS_PTR) */
+
++ }
+ break;
+ #endif /* defined(HASEXT2FS) */
+
+@@ -631,11 +697,26 @@ process_overlaid_node:
-@@ -628,14 +638,22 @@
- dev = i.i_dev;
- devs = 1;
- if ((type == VCHR) || (type == VBLK)) {
--
#if defined(HASI_FFS)
-- rdev = i.i_ffs_rdev;
+ rdev = i.i_ffs_rdev;
++ rdevs = 1;
#else /* !defined(HASI_FFS) */
-+#ifdef i_ffs1_rdev
-+ struct ufs1_dinode din;
-+ if (i.i_din.ffs1_din &&
-+ !kread((KA_T)i.i_din.ffs1_din, (char *)&din, sizeof(din))) {
-+ rdev = din.di_rdev;
-+ rdevs = 1;
-+ } else
-+ rdevs = 0;
-+#else
++# if defined(HASI_FFS1)
++ if (ffs == 1) {
++ if (u1s) {
++ rdev = u1.di_rdev;
++ rdevs = 1;
++ }
++ } else if (ffs == 2) {
++ if (u2s) {
++ rdev = u2.di_rdev;
++ rdevs = 1;
++ }
++ }
++# else /* !defined(HASI_FFS1) */
rdev = i.i_rdev;
+ rdevs = 1;
-+#endif
++# endif /* defined(HASI_FFS1) */
#endif /* defined(HASI_FFS) */
- rdevs = 1;
}
break;
+@@ -807,11 +888,26 @@ process_overlaid_node:
+
+ #if defined(HASI_FFS)
+ Lf->sz = (SZOFFTYPE)i.i_ffs_size;
++ Lf->sz_def = 1;
+ #else /* !defined(HASI_FFS) */
++# if defined(HASI_FFS1)
++ if (ffs == 1) {
++ if (u1s) {
++ Lf->sz = (SZOFFTYPE)u1.di_size;
++ Lf->sz_def = 1;
++ }
++ } else if (ffs == 2) {
++ if (u2s) {
++ Lf->sz = (SZOFFTYPE)u2.di_size;
++ Lf->sz_def = 1;
++ }
++ }
++# else /* !defined(HASI_FFS1) */
+ Lf->sz = (SZOFFTYPE)i.i_size;
++ Lf->sz_def = 1;
++# endif /* defined(HASI_FFS1) */
+ #endif /* defined(HASI_FFS) */
+
+- Lf->sz_def = 1;
+ }
+
+ #if defined(HASMSDOSFS)
+@@ -828,14 +924,15 @@ process_overlaid_node:
+
+ #if defined(HASEXT2FS)
+ else if (nty == EXT2NODE) {
+-
+-# if defined(HASI_E2FS)
++# if defined(HASI_E2FS_PTR)
++ if (edp) {
++ Lf->sz = (SZOFFTYPE)edp->e2di_size;
++ Lf->sz_def = 1;
++ }
++# else /* !defined(HASI_E2FS_PTR) */
+ Lf->sz = (SZOFFTYPE)i.i_e2fs_size;
+-# else /* !defined(HASI_E2FS) */
+- Lf->sz = (SZOFFTYPE)i.i_size;
+-# endif /* defined(HASI_E2FS) */
+-
+ Lf->sz_def = 1;
++# endif /* defined(HASI_E2FS_PTR) */
+ }
+ #endif /* defined(HASEXT2FS) */
+
+@@ -880,8 +977,24 @@ process_overlaid_node:
+
+ # if defined(HASI_FFS)
+ Lf->nlink = (long)i.i_ffs_nlink;
++ Lf->nlink_def = 1;
+ # else /* !defined(HASI_FFS) */
++# if defined(HASI_FFS1)
++ if (ffs == 1) {
++ if (u1s) {
++ Lf->nlink = (long)u1.di_nlink;
++ Lf->nlink_def = 1;
++ }
++ } else if (ffs == 2) {
++ if (u2s) {
++ Lf->nlink = (long)u2.di_nlink;
++ Lf->nlink_def = 1;
++ }
++ }
++# else /* !defined(HASI_FFS1) */
+ Lf->nlink = (long)i.i_nlink;
++ Lf->nlink_def = 1;
++# endif /* defined(HASI_FFS1) */
+ # endif /* defined(HASI_FFS) */
+
+ Lf->nlink_def = 1;
+@@ -897,8 +1010,15 @@ process_overlaid_node:
+
+ #if defined(HASEXT2FS)
+ else if (nty == EXT2NODE) {
+- Lf->nlink - (long)i.i_e2fs_nlink;
++# if defined(HASI_E2FS_PTR)
++ if (edp) {
++ Lf->nlink = (long)edp->e2di_nlink;
++ Lf->nlink_def = 1;
++ }
++# else /* !defined(HASI_E2FS_PTR) */
++ Lf->nlink = (long)i.i_e2fs_nlink;
+ Lf->nlink_def = 1;
++# endif /* defined(HASI_E2FS_PTR) */
+ }
+ #endif /* defined(HASEXT2FS) */
+
diff --git a/sysutils/lsof/patches/patch-ac b/sysutils/lsof/patches/patch-ac
new file mode 100644
index 00000000000..66f89e3f4aa
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ac
@@ -0,0 +1,71 @@
+$NetBSD: patch-ac,v 1.8 2003/05/03 16:55:29 atatat Exp $
+
+--- dialects/n+obsd/dlsof.h.orig 2003-03-23 14:51:12.000000000 -0500
++++ dialects/n+obsd/dlsof.h
+@@ -73,7 +73,17 @@ struct buf; /* dummy for function protot
+
+ #define NFS
+ #define m_stat mnt_stat
++
++# if defined(NETBSDV) && __NetBSD_Version__>=106060000
++#define _KERNEL
++# endif /* defined(NETBSDV) && __NetBSD_Version__>=106060000 */
++
+ #include <sys/mount.h>
++
++# if defined(NETBSDV) && __NetBSD_Version__>=106060000
++#undef _KERNEL
++# endif /* defined(NETBSDV) && __NetBSD_Version__>=106060000 */
++
+ #include <rpc/types.h>
+ #include <sys/protosw.h>
+
+@@ -87,6 +97,7 @@ struct buf; /* dummy for function protot
+ #include <msdosfs/bpb.h>
+ #include <msdosfs/fat.h>
+
++# if defined(OPENBSDV) || (defined(NETBSDV) && __NetBSD_Version__<106060000)
+ /*
+ * As a terrible hack, the lsof Configure script extracts the netcred and
+ * netexport structure definitions from <sys/mount.h> and places them in
+@@ -100,9 +111,14 @@ struct buf; /* dummy for function protot
+ *
+ * THIS IS A TERRIBLE AND FRAGILE HACK!!! It might break if the netexport or
+ * netcred definitions change radically in <sys/mount.h>.
++ *
++ * It is no longer needed for NetBSD Versions 1.6F and above.
+ */
+
+ #include "netexport.h"
++# endif /* defined(OPENBSDV)
++ || (defined(NETBSDV) && __NetBSD_Version__<106060000) */
++
+ #define _KERNEL
+ struct nameidata; /* to satisfy a function prototype in msdosfsmount.h */
+ #include <msdosfs/msdosfsmount.h>
+@@ -178,6 +194,12 @@ struct sockproto {
+ #undef DIRBLKSIZ
+ # endif /* defined(DIRBLKSIZ) */
+
++# if defined(HASI_FFS1)
++#define _KERNEL
++#include <ufs/ufs/ufsmount.h>
++#undef _KERNEL
++# endif /* defined(HASI_FFS1) */
++
+ #include <ufs/ufs/inode.h>
+
+ # if defined(DIRENT_BLKSIZ)
+@@ -223,9 +245,10 @@ struct sockproto {
+
+ # if defined(HASNULLFS)
+ #define _KERNEL
+-# if defined(NETBSDV) && NETBSDV>=1050
++# if defined(NETBSDV) && NETBSDV>=1050 && __NetBSD_Version__<106060000
+ #include "netexport.h"
+-# endif /* defined(NETBSDV) && NETBSDV>=1050 */
++# endif /* defined(NETBSDV) && NETBSDV>=1050
++ && __NetBSD_Version__<106060000 */
+ #include <miscfs/nullfs/null.h>
+ #undef _KERNEL
+ # endif /* defined(HASNULLFS) */
diff --git a/sysutils/lsof/patches/patch-ad b/sysutils/lsof/patches/patch-ad
new file mode 100644
index 00000000000..7921c412beb
--- /dev/null
+++ b/sysutils/lsof/patches/patch-ad
@@ -0,0 +1,151 @@
+$NetBSD: patch-ad,v 1.3 2003/05/03 16:55:30 atatat Exp $
+
+--- Configure.orig 2003-03-23 14:28:10.000000000 -0500
++++ Configure
+@@ -169,9 +169,9 @@ then
+ LSOF_VSTR=""
+ fi # }
+
+-# Make sure the help file is removed before an abnormal exit.
++# Make sure temporary files are removed before an abnormal exit.
+
+-trap 'rm -f $LSOF_HLP ${LSOF_TMPC_BASE}*; exit 1' 1 2 3 15
++trap 'rm -f ${LSOF_HLP_BASE}* ${LSOF_TMPC_BASE}*; exit 1' 1 2 3 15
+
+ rm -f $LSOF_HLP
+ cat > $LSOF_HLP << LSOF_HLP
+@@ -230,11 +230,11 @@ do
+ echo "(cd ${LSOF_TSTSUBD}; make spotless)"
+ (cd ${LSOF_TSTSUBD}; make spotless)
+ else
+- echo '(cd ${LSOF_TSTSUBD); rm *.o config.*)'
++ echo '(cd ${LSOF_TSTSUBD}; rm *.o config.*)'
+ (cd ${LSOF_TSTSUBD}; rm *.o config.*)
+ fi # }
+- rm -f $LSOF_F $LSOF_HLP $LSOF_MKFC ${LSOF_TMPC_BASE}*
+- echo rm -f $LSOF_F $LSOF_HLP $LSOF_MKFC ${LSOF_TMPC_BASE}*
++ rm -f $LSOF_F $LSOF_MKFC ${LSOF_TMPC_BASE}*
++ echo rm -f $LSOF_F $LSOF_MKFC ${LSOF_TMPC_BASE}*
+ rm -rf AFSHeaders AFSVersion version.h
+ echo "rm -rf AFSHeaders AFSVersion version.h"
+ rm -f ${LSOF_HLP_BASE}* cd9660_node.h
+@@ -2212,15 +2212,21 @@ kernel generation process.
+ if test $? -eq 0 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASI_FFS"
++ else
++ grep -q i_ffs1_size ${LSOF_INCLUDE}/ufs/ufs/inode.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASI_FFS1"
++ fi #}
+ fi # }
+ grep -q VT_EXT2FS ${LSOF_INCLUDE}/sys/vnode.h
+ if test $? -eq 0 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASEXT2FS"
+- grep -q i_e2fs_size ${LSOF_INCLUDE}/ufs/ufs/inode.h
++ grep -q "*e2fs_din" ${LSOF_INCLUDE}/ufs/ufs/inode.h
+ if test $? -eq 0 # {
+ then
+- LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS"
++ LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS_PTR"
+ fi # }
+ fi # }
+ if test -r ${LSOF_INCLUDE}/nfs/nfsnode.h # {
+@@ -2272,7 +2278,7 @@ kernel generation process.
+ if test -r ${LSOF_INCLUDE}/sys/mount.h # {
+ then
+
+- # Build the netexport.h header file for NetBSD from <sys/mount.h>.
++ # Build the netexport.h header file for NetBSD.
+
+ LSOF_TMP1=${LSOF_TMPC}.edscr
+ LSOF_TMP2=${LSOF_TMPC}.netcred
+@@ -2447,23 +2453,10 @@ kernel generation process.
+ # If the OpenBSD version isn't pre-defined, determine it.
+
+ case $LSOF_VSTR in # {
+- 1.2*)
++ 1*)
+ LSOF_VERS=1020
+- ;;
+- 2.0*)
+- LSOF_VERS=2000
+- ;;
+- 2.1*)
+- LSOF_VERS=2010
+- ;;
+- 2.2*)
+- LSOF_VERS=2020
+- ;;
+- 2.3*)
+- LSOF_VERS=2030
+- ;;
+- 2.4*)
+- LSOF_VERS=2040
++ echo "!!!WARNING!!! Unsupported OpenBSD 1.x version: $LSOF_VSTR"
++ echo "!!!WARNING!!! Configuring for OpenBSD 1.2"
+ ;;
+ 2.5*)
+ LSOF_VERS=2050
+@@ -2483,6 +2476,12 @@ kernel generation process.
+ LSOF_TSTBIGF=" "
+ LSOF_VERS=2090
+ ;;
++ 2*)
++ LSOF_TSTBIGF=" "
++ LSOF_VERS=2090
++ echo "!!!WARNING!!! Unsupported OpenBSD 2.x version: $LSOF_VSTR"
++ echo "!!!WARNING!!! Configuring for OpenBSD 2.9"
++ ;;
+ 3.0*)
+ LSOF_TSTBIGF=" "
+ LSOF_VERS=3000
+@@ -2495,15 +2494,20 @@ kernel generation process.
+ LSOF_TSTBIGF=" "
+ LSOF_VERS=3020
+ ;;
++ 3.3*)
++ LSOF_TSTBIGF=" "
++ LSOF_VERS=3030
++ ;;
+ 3*)
+- LSOF_VERS=3010
+- echo "!!!WARNING!!! Unsupported OpenBSD version: $LSOF_VSTR"
+- echo "!!!WARNING!!! Configuring for OpenBSD 3.1"
++ LSOF_TSTBIGF=" "
++ LSOF_VERS=3020
++ echo "!!!WARNING!!! Unsupported OpenBSD 3.x version: $LSOF_VSTR"
++ echo "!!!WARNING!!! Configuring for OpenBSD 3.2"
+ ;;
+ *)
+ echo "Unknown OpenBSD release: $LSOF_VSTR"
+- echo Assuming OpenBSD 1.2
+- LSOF_VERS=1020
++ echo Assuming OpenBSD 3.2
++ LSOF_VERS=3020
+ ;;
+ esac # }
+ fi # }
+@@ -2511,7 +2515,7 @@ kernel generation process.
+ # Test for legal OpenBSD version.
+
+ case $LSOF_VERS in # {
+- 1020|2000|2010|2020|2030|2040|2050|2060|2070|2080|2090|3000|3010|3020)
++ 1020|2050|2060|2070|2080|2090|3000|3010|3020|3030)
+ ;;
+ *)
+ echo "Unknown OpenBSD version: $LSOF_VERS"
+@@ -2597,6 +2601,11 @@ kernel generation process.
+ if test $? -eq 0 # {
+ then
+ LSOF_CFGF="$LSOF_CFGF -DHASEXT2FS"
++ grep -q "*e2fs_din" ${LSOF_INCLUDE}/ufs/ufs/inode.h
++ if test $? -eq 0 # {
++ then
++ LSOF_CFGF="$LSOF_CFGF -DHASI_E2FS_PTR"
++ fi # }
+ fi # }
+ grep -q nc_vpid ${LSOF_INCLUDE}/sys/namei.h
+ if test $? -eq 0 # {