OpenPKG CVS Repository http://cvs.openpkg.org/ ____________________________________________________________________________
Server: cvs.openpkg.org Name: Ralf S. Engelschall Root: /v/openpkg/cvs Email: [EMAIL PROTECTED] Module: openpkg-src Date: 10-Feb-2006 20:27:24 Branch: OPENPKG_2_5_SOLID Handle: 2006021019272400 Added files: (Branch: OPENPKG_2_5_SOLID) openpkg-src/lsof lsof.patch Modified files: (Branch: OPENPKG_2_5_SOLID) openpkg-src/lsof lsof.spec Log: MFC: fix building under FreeBSD 6.0 Summary: Revision Changes Path 1.7.6.1 +76 -0 openpkg-src/lsof/lsof.patch 1.56.2.2 +3 -1 openpkg-src/lsof/lsof.spec ____________________________________________________________________________ patch -p0 <<'@@ .' Index: openpkg-src/lsof/lsof.patch ============================================================================ $ cvs diff -u -r0 -r1.7.6.1 lsof.patch --- /dev/null 2006-02-10 20:27:23 +0100 +++ lsof.patch 2006-02-10 20:27:24 +0100 @@ -0,0 +1,76 @@ +Index: lsof_4.76_src/dialects/freebsd/dlsof.h +--- lsof_4.76_src/dialects/freebsd/dlsof.h.orig 2005-08-08 21:49:26 +0200 ++++ lsof_4.76_src/dialects/freebsd/dlsof.h 2006-02-10 19:24:29 +0100 +@@ -297,6 +297,10 @@ + #define MALLOC_DECLARE(type) extern struct malloc_type type[1] + /* to pacify <sys/lockf.h> */ + #define _KERNEL ++#if FREEBSDV>=6000 ++#include <sys/sx.h> ++#include <fs/devfs/devfs_int.h> ++#endif /* FREEBSDV>=6000 */ + #include <fs/devfs/devfs.h> + #undef _KERNEL + # endif /* FREEBSDV>=5000 */ +Index: lsof_4.76_src/dialects/freebsd/dmnt.c +--- lsof_4.76_src/dialects/freebsd/dmnt.c.orig 2005-08-08 21:49:27 +0200 ++++ lsof_4.76_src/dialects/freebsd/dmnt.c 2006-02-10 19:25:57 +0100 +@@ -78,8 +78,24 @@ + struct stat sb; + static ss = 0; + +- if (ss) +- return(c->si_inode ^ s); ++# if defined(HAS_SI_PRIV) ++/* ++ * If the cdev structure has a private sub-structure, read it. ++ */ ++ struct cdev_priv sp; ++ ++ if (!c->si_priv || kread((KA_T)c->si_priv, (char *)&sp, sizeof(sp))) ++ return(0); ++#endif /* defined(HAS_SI_PRIV) */ ++ ++ if (ss) { ++# if defined(HAS_SI_PRIV) ++ return(sp.cdp_inode ^ s); ++# else /* !defined(HAS_SI_PRIV) */ ++ return(c->si_inode ^ s); ++#endif /* defined(HAS_SI_PRIV) */ ++ } ++ + /* + * Determine the random udev seed from stat(2) operations on "/" and + * its device. +@@ -160,8 +176,14 @@ + * If the device seed is known, return its application to the cdev structure's + * inode. + */ +- if (ss) +- return(c->si_inode ^ s); ++ if (ss) { ++# if defined(HAS_SI_PRIV) ++ return(sp.cdp_inode ^ s); ++# else /* !defined(HAS_SI_PRIV) */ ++ return(c->si_inode ^ s); ++#endif /* defined(HAS_SI_PRIV) */ ++ } ++ + (void) fprintf(stderr, "%s: can't determine user device random seed.\n", Pn); + Exit(1); + } +Index: lsof_4.76_src/dialects/freebsd/machine.h +--- lsof_4.76_src/dialects/freebsd/machine.h.orig 2005-08-29 12:21:48 +0200 ++++ lsof_4.76_src/dialects/freebsd/machine.h 2006-02-10 19:24:29 +0100 +@@ -427,6 +427,11 @@ + */ + + /* #define HASSECURITY 1 */ ++#if FREEBSDV>=6000 ++#define HASSECURITY 1 ++#define HAS_SI_PRIV 1 ++#endif /* FREEBSDV>=6000 */ ++ + + + /* @@ . patch -p0 <<'@@ .' Index: openpkg-src/lsof/lsof.spec ============================================================================ $ cvs diff -u -r1.56.2.1 -r1.56.2.2 lsof.spec --- openpkg-src/lsof/lsof.spec 11 Oct 2005 12:50:43 -0000 1.56.2.1 +++ openpkg-src/lsof/lsof.spec 10 Feb 2006 19:27:24 -0000 1.56.2.2 @@ -33,10 +33,11 @@ Group: Filesystem License: BSD Version: 4.76 -Release: 2.5.0 +Release: 2.5.1 # list of sources Source0: ftp://lsof.itap.purdue.edu/pub/tools/unix/lsof/lsof_%{version}.tar.gz +Patch0: lsof.patch # build information Prefix: %{l_prefix} @@ -60,6 +61,7 @@ %prep %setup -q -n lsof_%{version} %{l_tar} xf lsof_%{version}_src.tar + %patch -p0 %build cd lsof_%{version}_src @@ . ______________________________________________________________________ The OpenPKG Project www.openpkg.org CVS Repository Commit List openpkg-cvs@openpkg.org