Date: Sat, 8 Jun 2002 18:12:41 -0400 (EDT) From: Alan Eldridge <ports@geeksrus.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/39049: devel/fam: update to 2.6.8, massive patch reorganization Message-ID: <200206082212.g58MCf1k027394@wwweasel.geeksrus.net>
next in thread | raw e-mail | index | archive | help
>Number: 39049 >Category: ports >Synopsis: devel/fam: update to 2.6.8, massive patch reorganization >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sat Jun 08 15:20:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Alan Eldridge >Release: FreeBSD 4.6-RC i386 >Organization: Geeksrus.NET >Environment: System: FreeBSD wwweasel.geeksrus.net 4.6-RC FreeBSD 4.6-RC #1: Sun May 26 13:08:49 EDT 2002 root@wwweasel.geeksrus.net:/usr/obj/usr/src/sys/WWWEASEL i386 >Description: Update fam to current version 2.6.8. Reorg patches so there is one patch per patched file, to simplify future maintenance. Changed patches that create new source files to the files themselves, which are copied into place. It's easier to read diffs than diffs of diffs. 8=) >How-To-Repeat: >Fix: There are two steps. Step 1. Apply this gigantic patch. ==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<== Index: devel/fam/Makefile =================================================================== RCS file: /home/ncvs/ports/devel/fam/Makefile,v retrieving revision 1.4 diff -u -3 -r1.4 Makefile --- devel/fam/Makefile 8 Jun 2002 04:21:22 -0000 1.4 +++ devel/fam/Makefile 8 Jun 2002 21:33:31 -0000 @@ -6,22 +6,27 @@ # PORTNAME= fam -PORTVERSION= 2.6.4 -PORTREVISION= 1 +PORTVERSION= 2.6.8 CATEGORIES= devel MASTER_SITES= ftp://oss.sgi.com/projects/fam/download/ -DISTNAME= ${PORTNAME}-oss-${PORTVERSION} MAINTAINER= ports@geeksrus.net USE_AUTOMAKE_VER=14 USE_LIBTOOL= yes USE_GMAKE= yes -PATCH_STRIP= -p1 INSTALLS_SHLIB= yes MAN1= fam.1m MAN3= fam.3x + +pre-configure: + ${RM} -fr ${WRKSRC}/util + ${CP} ${FILESDIR}/fam-mntent.h ${WRKSRC}/fam/mntent.h + ${CP} ${FILESDIR}/fam-mntent_compat.c++ ${WRKSRC}/fam/mntent_compat.c++ + ${MV} ${WRKSRC}/Makefile.am ${WRKSRC}/Makefile.am.orig + ${SED} -e s/util// -e /SUBDIRS/q \ + <${WRKSRC}/Makefile.am.orig >${WRKSRC}/Makefile.am post-install: @${INSTALL_SCRIPT} -m 751 ${FILESDIR}/fam.sh.sample ${PREFIX}/etc/rc.d/fam.sh.sample Index: devel/fam/distinfo =================================================================== RCS file: /home/ncvs/ports/devel/fam/distinfo,v retrieving revision 1.1 diff -u -3 -r1.1 distinfo --- devel/fam/distinfo 31 Mar 2001 02:45:55 -0000 1.1 +++ devel/fam/distinfo 8 Jun 2002 06:02:10 -0000 @@ -1 +1 @@ -MD5 (fam-oss-2.6.4.tar.gz) = d060919b3d9ede61a8b68eae1ded53ce +MD5 (fam-2.6.8.tar.gz) = 2e02ae47d52122511d079b78b06ade4b Index: devel/fam/pkg-plist =================================================================== RCS file: /home/ncvs/ports/devel/fam/pkg-plist,v retrieving revision 1.3 diff -u -3 -r1.3 pkg-plist --- devel/fam/pkg-plist 8 Jun 2002 04:21:22 -0000 1.3 +++ devel/fam/pkg-plist 8 Jun 2002 06:02:10 -0000 @@ -2,9 +2,8 @@ etc/fam.conf etc/rc.d/fam.sh.sample include/fam.h -lib/fam/editconf.perl lib/libfam.a +lib/libfam.la lib/libfam.so lib/libfam.so.0 -@dirrm lib/fam @unexec rm -f %D/etc/rc.d/fam.sh || true Index: devel/fam/files/fam-mntent.h =================================================================== RCS file: devel/fam/files/fam-mntent.h diff -N devel/fam/files/fam-mntent.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/fam-mntent.h 8 Jun 2002 21:28:42 -0000 @@ -0,0 +1,56 @@ +/* + * mntent + * mntent.h - compatability header for FreeBSD + * + * Copyright (c) 2001 David Rufino <daverufino@btinternet.com> + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#if defined(HAVE_MNTENT_H) +#include <mntent.h> +#else +#ifndef _MNTENT_H +#define _MNTENT_H +#include <stdio.h> + +#define MOUNTED "dummy" + +#define MNTTYPE_NFS "nfs" + +struct mntent { + char *mnt_fsname; + char *mnt_dir; + char *mnt_type; + char *mnt_opts; + int mnt_freq; + int mnt_passno; +}; + +#define setmntent(x,y) ((FILE *)0x1) +struct mntent *getmntent __P ((FILE *fp)); +char *hasmntopt __P ((const struct mntent *mnt, const char *option)); +#define endmntent(x) ((int)1) + +#endif /* _MNTENT_H */ +#endif /* HAVE_MNTENT_H */ Index: devel/fam/files/fam-mntent_compat.c++ =================================================================== RCS file: devel/fam/files/fam-mntent_compat.c++ diff -N devel/fam/files/fam-mntent_compat.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/fam-mntent_compat.c++ 8 Jun 2002 21:28:42 -0000 @@ -0,0 +1,151 @@ +/* + * Copyright (c) 1980, 1989, 1993, 1994 + * The Regents of the University of California. All rights reserved. + * Copyright (c) 2001 + * David Rufino <daverufino@btinternet.com> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +/* most of this was ripped from the mount(3) source */ + +#include "config.h" +#include "mntent.h" +#if !defined(HAVE_MNTENT_H) +#include <stdlib.h> +#include <string.h> +#include <sys/param.h> +#include <sys/ucred.h> +#include <sys/mount.h> + +static int pos = -1; +static int mntsize = -1; +static struct mntent _mntent; + +char * +hasmntopt (const struct mntent *mnt, const char *option) +{ + int found; + char *opt, *optbuf; + + optbuf = strdup(mnt->mnt_opts); + found = 0; + for (opt = optbuf; (opt = strtok(opt, " ")) != NULL; opt = NULL) { + if (!strcasecmp(opt, option)) { + opt = opt - optbuf + mnt->mnt_opts; + free (optbuf); + return (opt); + } + } + free (optbuf); + return (NULL); +} + +static char * +catopt (char *s0, const char *s1) +{ + size_t i; + char *cp; + + if (s1 == NULL || *s1 == '\0') + return s0; + if (s0 && *s0) { + i = strlen(s0) + strlen(s1) + 1 + 1; + if ((cp = (char *)malloc(i)) == NULL) + return (NULL); + (void)snprintf(cp, i, "%s %s", s0, s1); + } else + cp = strdup(s1); + + if (s0) + free(s0); + return (cp); +} + + +static char * +flags2opts (int flags) +{ + char *res; + res = NULL; + res = catopt(res, (flags & MNT_RDONLY) ? "ro" : "rw"); + if (flags & MNT_SYNCHRONOUS) res = catopt(res, "sync"); + if (flags & MNT_NOEXEC) res = catopt(res, "noexec"); + if (flags & MNT_NOSUID) res = catopt(res, "nosuid"); + if (flags & MNT_NODEV) res = catopt(res, "nodev"); + if (flags & MNT_UNION) res = catopt(res, "union"); + if (flags & MNT_ASYNC) res = catopt(res, "async"); + if (flags & MNT_NOATIME) res = catopt(res, "noatime"); + if (flags & MNT_NOCLUSTERR) res = catopt(res, "noclusterr"); + if (flags & MNT_NOCLUSTERW) res = catopt(res, "noclusterw"); + if (flags & MNT_NOSYMFOLLOW) res = catopt(res, "nosymfollow"); + if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir"); + + return res; +} + +static struct mntent * +statfs_to_mntent (struct statfs *mntbuf) +{ + static char opts_buf[40], *tmp; + + _mntent.mnt_fsname = mntbuf->f_mntfromname; + _mntent.mnt_dir = mntbuf->f_mntonname; + _mntent.mnt_type = mntbuf->f_fstypename; + tmp = flags2opts (mntbuf->f_flags); + if (tmp) { + opts_buf[sizeof(opts_buf)-1] = '\0'; + strncpy (opts_buf, tmp, sizeof(opts_buf)-1); + free (tmp); + } else { + *opts_buf = '\0'; + } + _mntent.mnt_opts = opts_buf; + _mntent.mnt_freq = _mntent.mnt_passno = 0; + return (&_mntent); +} + +struct mntent * +getmntent (FILE *fp) +{ + struct statfs *mntbuf; + + if (pos == -1 || mntsize == -1) + mntsize = getmntinfo (&mntbuf, MNT_NOWAIT); + + ++pos; + if (pos == mntsize) { + pos = mntsize = -1; + return (NULL); + } + + return (statfs_to_mntent (&mntbuf[pos])); +} + +#endif /* HAVE_MNTENT_H */ Index: devel/fam/files/patch-Makefile.am =================================================================== RCS file: devel/fam/files/patch-Makefile.am diff -N devel/fam/files/patch-Makefile.am --- devel/fam/files/patch-Makefile.am 31 Mar 2001 02:45:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,33 +0,0 @@ ---- Makefile.am.orig Fri May 19 23:46:31 2000 -+++ Makefile.am Mon Mar 19 11:51:05 2001 -@@ -7,30 +7,3 @@ - rpm: dist - @cd build && $(MAKE) $(AM_MAKEFLAGS) rpm - --# We proceed even if these commands fail because this might be an install --# into $DESTDIR by a non-root user. --install-exec-hook: -- -@if test "no$(LDCONFIG)" != "no"; then \ --## echo "Adding $(libdir) to ld.so.conf..."; \ -- $(EDITCONF) ld.so.conf add $(DESTDIR)$(libdir) $(DESTDIR)$(libdir); \ -- exec $(LDCONFIG); \ -- fi --## @echo "Adding fam to rpc..." -- -@$(EDITCONF) rpc add 391002 "sgi_fam 391002" --## @echo "Adding fam to inetd.conf..." -- -@$(EDITCONF) inetd.conf add '\b(fam|FAM)\b' \ -- "# fam, the File Alteration Monitor, http://oss.sgi.com/projects/fam/" \ -- "sgi_fam/1-2 stream rpc/tcp wait root $(DESTDIR)$(bindir)/fam fam" -- @echo "Restarting inetd..." -- -@killall -HUP inetd -- --# We don't remove $(libdir) from ld.so.conf here because we don't have --# a way to tell whether we're the ones who added it, and other things --# probably use it as well. --uninstall-local: --## @echo "Removing fam from rpc..." -- -@$(EDITCONF) rpc remove 391002 --## @echo "Removing fam from inetd.conf..." -- -@$(EDITCONF) inetd.conf remove '\b(fam|FAM)\b' -- @echo "Restarting inetd..." -- -@killall -HUP inetd Index: devel/fam/files/patch-acconfig.h =================================================================== RCS file: devel/fam/files/patch-acconfig.h diff -N devel/fam/files/patch-acconfig.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-acconfig.h 8 Jun 2002 20:59:01 -0000 @@ -0,0 +1,12 @@ +diff -ruN acconfig.h acconfig.h +--- acconfig.h Mon Apr 29 02:26:53 2002 ++++ acconfig.h Sat Jun 8 16:31:07 2002 +@@ -47,6 +47,8 @@ + ** Otherwise, we'll use MNTTYPE_NFS. */ + #undef HAVE_FSID_NFS2 + ++#undef HAVE_MNTENT_H ++ + /* Define if we have MNTTYPE_NFS2 */ + #define HAVE_MNTTYPE_NFS2 0 + Index: devel/fam/files/patch-config.h.in =================================================================== RCS file: devel/fam/files/patch-config.h.in diff -N devel/fam/files/patch-config.h.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-config.h.in 8 Jun 2002 20:59:21 -0000 @@ -0,0 +1,12 @@ +diff -ruN config.h.in config.h.in +--- config.h.in Sun Jun 2 22:08:52 2002 ++++ config.h.in Sat Jun 8 16:31:07 2002 +@@ -12,6 +12,8 @@ + /* Define if the system has imon and IMONIOC_ ioctl flags. */ + #undef HAVE_IMON + ++#undef HAVE_MNTENT_H ++ + /* Define if the system has the struct revokdi and the IMONIOC_REVOKDI + ** ioctl flag. (IRIX 5.3 doesn't.) + */ Index: devel/fam/files/patch-configure.in =================================================================== RCS file: devel/fam/files/patch-configure.in diff -N devel/fam/files/patch-configure.in --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-configure.in 8 Jun 2002 20:59:48 -0000 @@ -0,0 +1,36 @@ +diff -ruN configure.in configure.in +--- configure.in Mon Apr 29 03:55:42 2002 ++++ configure.in Sat Jun 8 16:31:07 2002 +@@ -99,6 +99,8 @@ + dnl AC_HEADER_SYS_WAIT + dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h syslog.h unistd.h) + ++AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H)) ++ + dnl + dnl See if imon is available; if so, is it IRIX or Linux? + dnl +@@ -314,10 +316,10 @@ + dnl If we don't have MNTTYPE_NFS , we croak. + dnl + +-FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) +-FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) +-FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) +-FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) ++dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) ++dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) ++dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) ++dnl FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) + + dnl + dnl Test for bindresvport() prototype. +@@ -569,8 +571,6 @@ + man/fam.1m + support/Makefile + test/Makefile +- util/Makefile +- util/editconf/Makefile + ) + + dnl Index: devel/fam/files/patch-fam-FileSystem.c++ =================================================================== RCS file: devel/fam/files/patch-fam-FileSystem.c++ diff -N devel/fam/files/patch-fam-FileSystem.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-FileSystem.c++ 8 Jun 2002 21:00:19 -0000 @@ -0,0 +1,12 @@ +diff -ruN fam/FileSystem.c++ fam/FileSystem.c++ +--- fam/FileSystem.c++ Mon Apr 29 02:26:54 2002 ++++ fam/FileSystem.c++ Sat Jun 8 16:31:07 2002 +@@ -22,7 +22,7 @@ + + #include "FileSystem.h" + +-#include <mntent.h> ++#include "mntent.h" + #include <string.h> + + #include "Event.h" Index: devel/fam/files/patch-fam-FileSystemTable.c++ =================================================================== RCS file: devel/fam/files/patch-fam-FileSystemTable.c++ diff -N devel/fam/files/patch-fam-FileSystemTable.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-FileSystemTable.c++ 8 Jun 2002 21:00:48 -0000 @@ -0,0 +1,14 @@ +diff -ruN fam/FileSystemTable.c++ fam/FileSystemTable.c++ +--- fam/FileSystemTable.c++ Wed May 29 00:17:42 2002 ++++ fam/FileSystemTable.c++ Sat Jun 8 16:31:07 2002 +@@ -256,7 +256,10 @@ + // create_fs_by_name initializes our "root" member variable. + if (!fs_by_name) + { create_fs_by_name(); ++#if !defined(__FreeBSD__) ++ /* there is no mtab "file" in freebsd! */ + mtab_watcher = new InternalClient(mtab_name, mtab_event_handler, NULL); ++#endif + } + + cr.become_user(); Index: devel/fam/files/patch-fam-IMon.c++ =================================================================== RCS file: devel/fam/files/patch-fam-IMon.c++ diff -N devel/fam/files/patch-fam-IMon.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-IMon.c++ 8 Jun 2002 21:01:23 -0000 @@ -0,0 +1,14 @@ +diff -ruN fam/IMon.c++ fam/IMon.c++ +--- fam/IMon.c++ Mon Apr 29 02:26:54 2002 ++++ fam/IMon.c++ Sat Jun 8 16:31:07 2002 +@@ -34,7 +34,9 @@ + #endif + #endif + +-#include <sys/sysmacros.h> ++#if !defined(__FreeBSD__) ++# include <sys/sysmacros.h> ++#endif + #include <unistd.h> + + #include "Interest.h" Index: devel/fam/files/patch-fam-Interest.c++ =================================================================== RCS file: devel/fam/files/patch-fam-Interest.c++ diff -N devel/fam/files/patch-fam-Interest.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-Interest.c++ 8 Jun 2002 21:01:59 -0000 @@ -0,0 +1,14 @@ +diff -ruN fam/Interest.c++ fam/Interest.c++ +--- fam/Interest.c++ Mon Apr 29 02:26:54 2002 ++++ fam/Interest.c++ Sat Jun 8 16:31:07 2002 +@@ -25,7 +25,9 @@ + #include <string.h> + #include <errno.h> + #include <sys/param.h> +-#include <sys/sysmacros.h> ++#if !defined(__FreeBSD__) ++# include <sys/sysmacros.h> ++#endif + + #ifdef HAVE_IRIX_XTAB_VERIFICATION + #include <stdio.h> Index: devel/fam/files/patch-fam-InternalClient.c++ =================================================================== RCS file: devel/fam/files/patch-fam-InternalClient.c++ diff -N devel/fam/files/patch-fam-InternalClient.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-InternalClient.c++ 8 Jun 2002 21:02:23 -0000 @@ -0,0 +1,13 @@ +diff -ruN fam/InternalClient.c++ fam/InternalClient.c++ +--- fam/InternalClient.c++ Mon Apr 29 02:26:54 2002 ++++ fam/InternalClient.c++ Sat Jun 8 16:31:07 2002 +@@ -35,8 +35,8 @@ + { + assert(filename); + assert(h); +- assert(filename[0] == '/'); + Log::debug("%s watching %s", name(), filename); ++ assert(filename[0] == '/'); + interest = new File(filename, this, Request(0), Cred::SuperUser); + } + Index: devel/fam/files/patch-fam-Listener.c++ =================================================================== RCS file: devel/fam/files/patch-fam-Listener.c++ diff -N devel/fam/files/patch-fam-Listener.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-Listener.c++ 8 Jun 2002 21:02:51 -0000 @@ -0,0 +1,39 @@ +diff -ruN fam/Listener.c++ fam/Listener.c++ +--- fam/Listener.c++ Wed May 29 00:19:26 2002 ++++ fam/Listener.c++ Sat Jun 8 16:31:07 2002 +@@ -207,7 +207,11 @@ + unsetenv("TMPDIR"); + + char *tmpfile = tempnam("/tmp", ".fam"); ++#if defined(__FreeBSD__) ++ sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; ++#else + sockaddr_un sun = { AF_UNIX, "" }; ++#endif + if(strlen(tmpfile) >= (sizeof(sun.sun_path) - 1)) + { + Log::error("tmpnam() too long for sun_path (%d >= %d)!", +@@ -277,7 +281,11 @@ + + // Get the new socket. + ++#if defined(__FreeBSD__) ++ struct sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; ++#else + struct sockaddr_un sun = { AF_UNIX, "" }; ++#endif + CONFIG_SOCKLEN_T sunlen = sizeof(sun); + int client_fd = accept(ofd, (struct sockaddr *) &sun, &sunlen); + if (client_fd < 0) +@@ -339,7 +347,11 @@ + void + Listener::dirty_ugly_hack() + { ++#if defined(__FreeBSD__) ++ static sockaddr_un sun = { sizeof (sockaddr_un), AF_UNIX, "/tmp/.fam_socket" }; ++#else + static sockaddr_un sun = { AF_UNIX, "/tmp/.fam_socket" }; ++#endif + + int sock = socket(PF_UNIX, SOCK_STREAM, 0); + if (sock < 0) Index: devel/fam/files/patch-fam-Log.c++ =================================================================== RCS file: devel/fam/files/patch-fam-Log.c++ diff -N devel/fam/files/patch-fam-Log.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-Log.c++ 8 Jun 2002 21:03:19 -0000 @@ -0,0 +1,12 @@ +diff -ruN fam/Log.c++ fam/Log.c++ +--- fam/Log.c++ Wed May 29 00:20:30 2002 ++++ fam/Log.c++ Sat Jun 8 16:31:07 2002 +@@ -28,6 +28,8 @@ + #include <stdlib.h> + #include <string.h> + #include <syslog.h> ++#include <sys/time.h> ++#include <sys/types.h> + #include <sys/resource.h> + #include <sys/stat.h> + #include <sys/time.h> Index: devel/fam/files/patch-fam-Makefile.am =================================================================== RCS file: devel/fam/files/patch-fam-Makefile.am diff -N devel/fam/files/patch-fam-Makefile.am --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-Makefile.am 8 Jun 2002 21:03:46 -0000 @@ -0,0 +1,11 @@ +diff -ruN fam/Makefile.am fam/Makefile.am +--- fam/Makefile.am Mon Apr 29 02:26:54 2002 ++++ fam/Makefile.am Sat Jun 8 16:31:07 2002 +@@ -72,6 +72,7 @@ + main.c++ \ + timeval.c++ \ + timeval.h \ ++ mntent_compat.c++ \ + @IMON_FUNCS@.c++ + + EXTRA_fam_SOURCES = IMonIrix.c++ IMonLinux.c++ IMonNone.c++ Index: devel/fam/files/patch-fam-Scheduler.h =================================================================== RCS file: devel/fam/files/patch-fam-Scheduler.h diff -N devel/fam/files/patch-fam-Scheduler.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-Scheduler.h 8 Jun 2002 21:04:11 -0000 @@ -0,0 +1,11 @@ +diff -ruN fam/Scheduler.h fam/Scheduler.h +--- fam/Scheduler.h Mon Apr 29 02:26:54 2002 ++++ fam/Scheduler.h Sat Jun 8 16:31:07 2002 +@@ -24,6 +24,7 @@ + #define Scheduler_included + + #include <sys/time.h> ++#include <string.h> + + #include "Boolean.h" + Index: devel/fam/files/patch-fam-StringTable.h =================================================================== RCS file: devel/fam/files/patch-fam-StringTable.h diff -N devel/fam/files/patch-fam-StringTable.h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-fam-StringTable.h 8 Jun 2002 21:04:49 -0000 @@ -0,0 +1,11 @@ +diff -ruN fam/StringTable.h fam/StringTable.h +--- fam/StringTable.h Mon Apr 29 02:26:54 2002 ++++ fam/StringTable.h Sat Jun 8 16:31:07 2002 +@@ -25,6 +25,7 @@ + + #include <assert.h> + #include <string.h> ++#include "mntent.h" + + // A StringTable maps C strings onto values. It is a cheap O(n) + // implementation, suitable only for small tables that are Index: devel/fam/files/patch-freebsd =================================================================== RCS file: devel/fam/files/patch-freebsd diff -N devel/fam/files/patch-freebsd --- devel/fam/files/patch-freebsd 31 Mar 2001 02:45:55 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,490 +0,0 @@ -diff -urN fam-oss-2.6.4/config.h.in fam-oss-2.6.4-freebsd/config.h.in ---- fam-oss-2.6.4/config.h.in Sat May 20 05:50:17 2000 -+++ fam-oss-2.6.4-freebsd/config.h.in Sun Mar 18 00:02:38 2001 -@@ -12,6 +12,8 @@ - /* Define if the system has imon and IMONIOC_ ioctl flags. */ - #undef HAVE_IMON - -+#undef HAVE_MNTENT_H -+ - /* Define if the system has the struct revokdi and the IMONIOC_REVOKDI - ** ioctl flag. (IRIX 5.3 doesn't.) - */ -diff -urN fam-oss-2.6.4/configure.in fam-oss-2.6.4-freebsd/configure.in ---- fam-oss-2.6.4/configure.in Sat May 20 06:23:17 2000 -+++ fam-oss-2.6.4-freebsd/configure.in Sun Mar 18 00:36:29 2001 -@@ -95,6 +95,8 @@ - dnl AC_HEADER_SYS_WAIT - dnl AC_CHECK_HEADERS(fcntl.h limits.h sys/time.h syslog.h unistd.h) - -+AC_CHECK_HEADER(mntent.h, AC_DEFINE(HAVE_MNTENT_H)) -+ - dnl - dnl See if imon is available; if so, is it IRIX or Linux? - dnl -@@ -299,10 +301,10 @@ - dnl If we don't have MNTTYPE_NFS , we croak. - dnl - --FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) --FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) --FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) --FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) -+dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS, ,AC_MSG_ERROR(Didn't find MNTTYPE_NFS in mntent.h)) -+dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS2, AC_DEFINE(HAVE_MNTTYPE_NFS2)) -+dnl FAM_DECL_IN_MNTENT(MNTTYPE_NFS3, AC_DEFINE(HAVE_MNTTYPE_NFS3)) -+dnl FAM_DECL_IN_MNTENT(MNTTYPE_CACHEFS, AC_DEFINE(HAVE_MNTTYPE_CACHEFS)) - - dnl - dnl Test for bindresvport() prototype. -diff -urN fam-oss-2.6.4/fam/Client.h fam-oss-2.6.4-freebsd/fam/Client.h ---- fam-oss-2.6.4/fam/Client.h Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/Client.h Sat Mar 17 00:14:35 2001 -@@ -23,6 +23,7 @@ - #ifndef Client_included - #define Client_included - -+#include <sys/types.h> - #include <netinet/in.h> // for in_addr - - #include "Activity.h" -diff -urN fam-oss-2.6.4/fam/FileSystem.c++ fam-oss-2.6.4-freebsd/fam/FileSystem.c++ ---- fam-oss-2.6.4/fam/FileSystem.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/FileSystem.c++ Sat Mar 17 13:18:10 2001 -@@ -22,7 +22,7 @@ - - #include "FileSystem.h" - --#include <mntent.h> -+#include "mntent.h" - #include <string.h> - - #include "Event.h" -diff -urN fam-oss-2.6.4/fam/FileSystemTable.c++ fam-oss-2.6.4-freebsd/fam/FileSystemTable.c++ ---- fam-oss-2.6.4/fam/FileSystemTable.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/FileSystemTable.c++ Sat Mar 17 23:44:17 2001 -@@ -21,9 +21,10 @@ - // Temple Place - Suite 330, Boston MA 02111-1307, USA. - - #include <stddef.h> -+#include <stdio.h> - #include "FileSystemTable.h" - --#include <mntent.h> -+#include "mntent.h" - #include <stdlib.h> - #include <string.h> - -@@ -255,7 +256,10 @@ - // create_fs_by_name initializes our "root" member variable. - if (!fs_by_name) - { create_fs_by_name(); -+#if !defined(__FreeBSD__) -+ /* there is no mtab "file" in freebsd! */ - mtab_watcher = new InternalClient(mtab_name, mtab_event_handler, NULL); -+#endif - } - - cr.become_user(); -diff -urN fam-oss-2.6.4/fam/IMon.c++ fam-oss-2.6.4-freebsd/fam/IMon.c++ ---- fam-oss-2.6.4/fam/IMon.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/IMon.c++ Sat Mar 17 14:06:17 2001 -@@ -34,7 +34,9 @@ - #endif - #endif - --#include <sys/sysmacros.h> -+#if !defined(__FreeBSD__) -+# include <sys/sysmacros.h> -+#endif - #include <unistd.h> - - #include "Interest.h" -diff -urN fam-oss-2.6.4/fam/Interest.c++ fam-oss-2.6.4-freebsd/fam/Interest.c++ ---- fam-oss-2.6.4/fam/Interest.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/Interest.c++ Sat Mar 17 14:06:37 2001 -@@ -25,7 +25,9 @@ - #include <string.h> - #include <errno.h> - #include <sys/param.h> --#include <sys/sysmacros.h> -+#if !defined(__FreeBSD__) -+# include <sys/sysmacros.h> -+#endif - - #ifdef HAVE_IRIX_XTAB_VERIFICATION - #include <stdio.h> -diff -urN fam-oss-2.6.4/fam/InternalClient.c++ fam-oss-2.6.4-freebsd/fam/InternalClient.c++ ---- fam-oss-2.6.4/fam/InternalClient.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/InternalClient.c++ Sat Mar 17 23:20:15 2001 -@@ -35,8 +35,8 @@ - { - assert(filename); - assert(h); -- assert(filename[0] == '/'); - Log::debug("%s watching %s", name(), filename); -+ assert(filename[0] == '/'); - interest = new File(filename, this, Request(0), Cred::SuperUser); - } - -diff -urN fam-oss-2.6.4/fam/Listener.c++ fam-oss-2.6.4-freebsd/fam/Listener.c++ ---- fam-oss-2.6.4/fam/Listener.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/Listener.c++ Sat Mar 17 14:12:57 2001 -@@ -22,6 +22,8 @@ - - #include "Listener.h" - -+#include <stdio.h> -+#include <stdlib.h> - #include <assert.h> - #include <fcntl.h> - #include <sys/types.h> -@@ -202,7 +204,11 @@ - // requested user and pass the name back to the client. - - char *tmpfile = tempnam("/tmp", ".fam"); -+#if defined(__FreeBSD__) -+ sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; -+#else - sockaddr_un sun = { AF_UNIX, "" }; -+#endif - if(strlen(tmpfile) >= (sizeof(sun.sun_path) - 1)) - { - Log::error("tmpnam() too long for sun_path (%d >= %d)!", -@@ -235,7 +241,7 @@ - return; - } - -- if (chown(sun.sun_path, uid, -1) != 0) -+ if (chown(sun.sun_path, uid, (gid_t)-1) != 0) - { Log::perror("localclient chown"); - close(client_sock); - return; -@@ -271,7 +277,11 @@ - - // Get the new socket. - -+#if defined(__FreeBSD__) -+ struct sockaddr_un sun = { sizeof(sockaddr_un), AF_UNIX, "" }; -+#else - struct sockaddr_un sun = { AF_UNIX, "" }; -+#endif - CONFIG_SOCKLEN_T sunlen = sizeof(sun); - int client_fd = accept(ofd, (struct sockaddr *) &sun, &sunlen); - if (client_fd < 0) -@@ -333,7 +343,11 @@ - void - Listener::dirty_ugly_hack() - { -+#if defined(__FreeBSD__) -+ static sockaddr_un sun = { sizeof (sockaddr_un), AF_UNIX, "/tmp/.fam_socket" }; -+#else - static sockaddr_un sun = { AF_UNIX, "/tmp/.fam_socket" }; -+#endif - - int sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (sock < 0) -diff -urN fam-oss-2.6.4/fam/Log.c++ fam-oss-2.6.4-freebsd/fam/Log.c++ ---- fam-oss-2.6.4/fam/Log.c++ Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/Log.c++ Sat Mar 17 14:14:31 2001 -@@ -28,6 +28,8 @@ - #include <stdlib.h> - #include <string.h> - #include <syslog.h> -+#include <sys/time.h> -+#include <sys/types.h> - #include <sys/resource.h> - #include <sys/stat.h> - #include <unistd.h> -diff -urN fam-oss-2.6.4/fam/Makefile.am fam-oss-2.6.4-freebsd/fam/Makefile.am ---- fam-oss-2.6.4/fam/Makefile.am Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/fam/Makefile.am Sat Mar 17 18:12:17 2001 -@@ -72,6 +72,7 @@ - main.c++ \ - timeval.c++ \ - timeval.h \ -+ mntent_compat.c++ \ - @IMON_FUNCS@.c++ - - EXTRA_fam_SOURCES = IMonIrix.c++ IMonLinux.c++ IMonNone.c++ -diff -urN fam-oss-2.6.4/fam/Scheduler.h fam-oss-2.6.4-freebsd/fam/Scheduler.h ---- fam-oss-2.6.4/fam/Scheduler.h Sat May 20 05:46:32 2000 -+++ fam-oss-2.6.4-freebsd/fam/Scheduler.h Sat Mar 17 00:14:04 2001 -@@ -24,6 +24,7 @@ - #define Scheduler_included - - #include <sys/time.h> -+#include <string.h> - - #include "Boolean.h" - -diff -urN fam-oss-2.6.4/fam/StringTable.h fam-oss-2.6.4-freebsd/fam/StringTable.h ---- fam-oss-2.6.4/fam/StringTable.h Sat May 20 05:46:32 2000 -+++ fam-oss-2.6.4-freebsd/fam/StringTable.h Sat Mar 17 18:05:38 2001 -@@ -25,6 +25,7 @@ - - #include <assert.h> - #include <string.h> -+#include "mntent.h" - - // A StringTable maps C strings onto values. It is a cheap O(n) - // implementation, suitable only for small tables that are -diff -urN fam-oss-2.6.4/fam/mntent.h fam-oss-2.6.4-freebsd/fam/mntent.h ---- fam-oss-2.6.4/fam/mntent.h Thu Jan 1 01:00:00 1970 -+++ fam-oss-2.6.4-freebsd/fam/mntent.h Sat Mar 17 18:11:08 2001 -@@ -0,0 +1,56 @@ -+/* -+ * mntent -+ * mntent.h - compatability header for FreeBSD -+ * -+ * Copyright (c) 2001 David Rufino <daverufino@btinternet.com> -+ * All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+#if defined(HAVE_MNTENT_H) -+#include <mntent.h> -+#else -+#ifndef _MNTENT_H -+#define _MNTENT_H -+#include <stdio.h> -+ -+#define MOUNTED "dummy" -+ -+#define MNTTYPE_NFS "nfs" -+ -+struct mntent { -+ char *mnt_fsname; -+ char *mnt_dir; -+ char *mnt_type; -+ char *mnt_opts; -+ int mnt_freq; -+ int mnt_passno; -+}; -+ -+#define setmntent(x,y) ((FILE *)0x1) -+struct mntent *getmntent __P ((FILE *fp)); -+char *hasmntopt __P ((const struct mntent *mnt, const char *option)); -+#define endmntent(x) ((int)1) -+ -+#endif /* _MNTENT_H */ -+#endif /* HAVE_MNTENT_H */ -diff -urN fam-oss-2.6.4/fam/mntent_compat.c++ fam-oss-2.6.4-freebsd/fam/mntent_compat.c++ ---- fam-oss-2.6.4/fam/mntent_compat.c++ Thu Jan 1 01:00:00 1970 -+++ fam-oss-2.6.4-freebsd/fam/mntent_compat.c++ Sat Mar 17 23:48:07 2001 -@@ -0,0 +1,151 @@ -+/* -+ * Copyright (c) 1980, 1989, 1993, 1994 -+ * The Regents of the University of California. All rights reserved. -+ * Copyright (c) 2001 -+ * David Rufino <daverufino@btinternet.com> -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in the -+ * documentation and/or other materials provided with the distribution. -+ * 3. All advertising materials mentioning features or use of this software -+ * must display the following acknowledgement: -+ * This product includes software developed by the University of -+ * California, Berkeley and its contributors. -+ * 4. Neither the name of the University nor the names of its contributors -+ * may be used to endorse or promote products derived from this software -+ * without specific prior written permission. -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -+ * SUCH DAMAGE. -+ */ -+ -+/* most of this was ripped from the mount(3) source */ -+ -+#include "config.h" -+#include "mntent.h" -+#if !defined(HAVE_MNTENT_H) -+#include <stdlib.h> -+#include <string.h> -+#include <sys/param.h> -+#include <sys/ucred.h> -+#include <sys/mount.h> -+ -+static int pos = -1; -+static int mntsize = -1; -+static struct mntent _mntent; -+ -+char * -+hasmntopt (const struct mntent *mnt, const char *option) -+{ -+ int found; -+ char *opt, *optbuf; -+ -+ optbuf = strdup(mnt->mnt_opts); -+ found = 0; -+ for (opt = optbuf; (opt = strtok(opt, " ")) != NULL; opt = NULL) { -+ if (!strcasecmp(opt, option)) { -+ opt = opt - optbuf + mnt->mnt_opts; -+ free (optbuf); -+ return (opt); -+ } -+ } -+ free (optbuf); -+ return (NULL); -+} -+ -+static char * -+catopt (char *s0, const char *s1) -+{ -+ size_t i; -+ char *cp; -+ -+ if (s1 == NULL || *s1 == '\0') -+ return s0; -+ if (s0 && *s0) { -+ i = strlen(s0) + strlen(s1) + 1 + 1; -+ if ((cp = (char *)malloc(i)) == NULL) -+ return (NULL); -+ (void)snprintf(cp, i, "%s %s", s0, s1); -+ } else -+ cp = strdup(s1); -+ -+ if (s0) -+ free(s0); -+ return (cp); -+} -+ -+ -+static char * -+flags2opts (int flags) -+{ -+ char *res; -+ res = NULL; -+ res = catopt(res, (flags & MNT_RDONLY) ? "ro" : "rw"); -+ if (flags & MNT_SYNCHRONOUS) res = catopt(res, "sync"); -+ if (flags & MNT_NOEXEC) res = catopt(res, "noexec"); -+ if (flags & MNT_NOSUID) res = catopt(res, "nosuid"); -+ if (flags & MNT_NODEV) res = catopt(res, "nodev"); -+ if (flags & MNT_UNION) res = catopt(res, "union"); -+ if (flags & MNT_ASYNC) res = catopt(res, "async"); -+ if (flags & MNT_NOATIME) res = catopt(res, "noatime"); -+ if (flags & MNT_NOCLUSTERR) res = catopt(res, "noclusterr"); -+ if (flags & MNT_NOCLUSTERW) res = catopt(res, "noclusterw"); -+ if (flags & MNT_NOSYMFOLLOW) res = catopt(res, "nosymfollow"); -+ if (flags & MNT_SUIDDIR) res = catopt(res, "suiddir"); -+ -+ return res; -+} -+ -+static struct mntent * -+statfs_to_mntent (struct statfs *mntbuf) -+{ -+ static char opts_buf[40], *tmp; -+ -+ _mntent.mnt_fsname = mntbuf->f_mntfromname; -+ _mntent.mnt_dir = mntbuf->f_mntonname; -+ _mntent.mnt_type = mntbuf->f_fstypename; -+ tmp = flags2opts (mntbuf->f_flags); -+ if (tmp) { -+ opts_buf[sizeof(opts_buf)-1] = '\0'; -+ strncpy (opts_buf, tmp, sizeof(opts_buf)-1); -+ free (tmp); -+ } else { -+ *opts_buf = '\0'; -+ } -+ _mntent.mnt_opts = opts_buf; -+ _mntent.mnt_freq = _mntent.mnt_passno = 0; -+ return (&_mntent); -+} -+ -+struct mntent * -+getmntent (FILE *fp) -+{ -+ struct statfs *mntbuf; -+ -+ if (pos == -1 || mntsize == -1) -+ mntsize = getmntinfo (&mntbuf, MNT_NOWAIT); -+ -+ ++pos; -+ if (pos == mntsize) { -+ pos = mntsize = -1; -+ return (NULL); -+ } -+ -+ return (statfs_to_mntent (&mntbuf[pos])); -+} -+ -+#endif /* HAVE_MNTENT_H */ -diff -urN fam-oss-2.6.4/libfam/Client.c++ fam-oss-2.6.4-freebsd/libfam/Client.c++ ---- fam-oss-2.6.4/libfam/Client.c++ Sat May 20 05:46:32 2000 -+++ fam-oss-2.6.4-freebsd/libfam/Client.c++ Sat Mar 17 00:12:01 2001 -@@ -20,6 +20,7 @@ - // with this program; if not, write the Free Software Foundation, Inc., 59 - // Temple Place - Suite 330, Boston MA 02111-1307, USA. - -+#include <stdio.h> - #include <stdlib.h> - #include <unistd.h> - #include <netinet/in.h> -diff -urN fam-oss-2.6.4/libfam/fam.c++ fam-oss-2.6.4-freebsd/libfam/fam.c++ ---- fam-oss-2.6.4/libfam/fam.c++ Sat May 20 05:46:32 2000 -+++ fam-oss-2.6.4-freebsd/libfam/fam.c++ Sat Mar 17 00:12:43 2001 -@@ -21,6 +21,7 @@ - // Temple Place - Suite 330, Boston MA 02111-1307, USA. - - #include <sys/types.h> -+#include <rpc/rpc.h> - #include <sys/time.h> - #include <unistd.h> - #include <stdlib.h> -diff -urN fam-oss-2.6.4/test/test.c++ fam-oss-2.6.4-freebsd/test/test.c++ ---- fam-oss-2.6.4/test/test.c++ Sat May 20 05:46:32 2000 -+++ fam-oss-2.6.4-freebsd/test/test.c++ Sat Mar 17 18:39:23 2001 -@@ -1,6 +1,7 @@ - #include <sys/types.h> - #include <sys/time.h> - #include <stdio.h> -+#include <string.h> - #include <unistd.h> - #include <signal.h> - #include <errno.h> ---- fam-oss-2.6.4/acconfig.h Sat May 20 05:46:31 2000 -+++ fam-oss-2.6.4-freebsd/acconfig.h Sun Mar 18 00:40:47 2001 -@@ -44,6 +44,8 @@ - ** Otherwise, we'll use MNTTYPE_NFS. */ - #undef HAVE_FSID_NFS2 - -+#undef HAVE_MNTENT_H -+ - /* Define if we have MNTTYPE_NFS2 */ - #define HAVE_MNTTYPE_NFS2 0 - Index: devel/fam/files/patch-libfam-Client.c++ =================================================================== RCS file: devel/fam/files/patch-libfam-Client.c++ diff -N devel/fam/files/patch-libfam-Client.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-libfam-Client.c++ 8 Jun 2002 21:08:33 -0000 @@ -0,0 +1,11 @@ +diff -ruN libfam/Client.c++ libfam/Client.c++ +--- libfam/Client.c++ Mon Apr 29 02:26:55 2002 ++++ libfam/Client.c++ Sat Jun 8 16:31:07 2002 +@@ -20,6 +20,7 @@ + // with this program; if not, write the Free Software Foundation, Inc., 59 + // Temple Place - Suite 330, Boston MA 02111-1307, USA. + ++#include <stdio.h> + #include <stdlib.h> + #include <unistd.h> + #include <netinet/in.h> Index: devel/fam/files/patch-libfam-fam.c++ =================================================================== RCS file: devel/fam/files/patch-libfam-fam.c++ diff -N devel/fam/files/patch-libfam-fam.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-libfam-fam.c++ 8 Jun 2002 21:08:54 -0000 @@ -0,0 +1,20 @@ +diff -ruN libfam/fam.c++ libfam/fam.c++ +--- libfam/fam.c++.orig Mon Apr 29 02:26:55 2002 ++++ libfam/fam.c++ Sat Jun 8 16:54:04 2002 +@@ -21,6 +21,7 @@ + // Temple Place - Suite 330, Boston MA 02111-1307, USA. + + #include <sys/types.h> ++#include <rpc/rpc.h> + #include <sys/time.h> + #include <unistd.h> + #include <stdlib.h> +@@ -80,7 +81,7 @@ + fc->client = new Client(LOCALHOSTNUMBER, famnumber, famversion); + fc->fd = ((Client *)fc->client)->getSock(); + if (fc->fd < 0) { +- delete fc->client; ++ delete (Client *)fc->client; + fc->client = NULL; + return(-1); + } Index: devel/fam/files/patch-test-test.c++ =================================================================== RCS file: devel/fam/files/patch-test-test.c++ diff -N devel/fam/files/patch-test-test.c++ --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ devel/fam/files/patch-test-test.c++ 8 Jun 2002 21:09:12 -0000 @@ -0,0 +1,11 @@ +diff -ruN test/test.c++ test/test.c++ +--- test/test.c++ Mon Apr 29 02:26:55 2002 ++++ test/test.c++ Sat Jun 8 16:31:07 2002 +@@ -1,6 +1,7 @@ + #include <sys/types.h> + #include <sys/time.h> + #include <stdio.h> ++#include <string.h> + #include <unistd.h> + #include <stdlib.h> + #include <signal.h> ==8<====8<====8<====8<====8<====8<====8<====8<====8<====8<== Step 2. in the 'files' subdir, execute the following commands: rm patch-Makefile.am cvs rm patch-Makefile.am rm patch-freebsd cvs rm patch-freebsd cvs add fam-mntent* cvs add patch-* That's it. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200206082212.g58MCf1k027394>