pkgsrc/sysutils/fam/patches/patch-ae
sketch 97ff422b68 Various fixes/cleanups to get this package compiling on Solaris:
+ Use the mnttab(4) interface instead of mntent.
 + C++ syntax cleanups to appease the SunPro compiler.
 + Use MAXPATHLEN instead of NAME_MAX which can be unimplemented on strict
   POSIX systems.
 + Use POSIX inttypes.h if BSD types are not available.
 + RPC includes and C++ namespace fixes.
 + Use dirent(3) instead of older sys/dir.h interface.
 + Avoid `sun' namespace collision.

Patch based on the work of Robert Lillack and others, described in
http://mail-index.netbsd.org/tech-pkg/2004/08/20/0005.html and tested with
SunPro and gcc.
2004-11-19 12:35:22 +00:00

42 lines
1.1 KiB
Text

$NetBSD: patch-ae,v 1.4 2004/11/19 12:35:22 sketch Exp $
--- src/FileSystem.c++.orig 2003-01-18 14:18:12.000000000 +0000
+++ src/FileSystem.c++ 2004-11-08 15:39:34.558377000 +0000
@@ -22,14 +22,20 @@
#include "FileSystem.h"
-#include <mntent.h>
+#include "fam-mntent.h"
#include <string.h>
#include "Event.h"
+#if defined(HAVE_SYS_MNTTAB_H)
+FileSystem::FileSystem(const mnttab& mnt)
+ : mydir (strcpy(new char[strlen(mnt.mnt_mountp) + 1], mnt.mnt_mountp)),
+ myfsname(strcpy(new char[strlen(mnt.mnt_special) + 1], mnt.mnt_special))
+#else
FileSystem::FileSystem(const mntent& mnt)
: mydir (strcpy(new char[strlen(mnt.mnt_dir ) + 1], mnt.mnt_dir )),
myfsname(strcpy(new char[strlen(mnt.mnt_fsname) + 1], mnt.mnt_fsname))
+#endif
{ }
FileSystem::~FileSystem()
@@ -40,9 +46,15 @@
}
bool
+#if defined(HAVE_SYS_MNTTAB_H)
+FileSystem::matches(const mnttab& mnt) const
+{
+ return !strcmp(mydir, mnt.mnt_mountp) && !strcmp(myfsname, mnt.mnt_special);
+#else
FileSystem::matches(const mntent& mnt) const
{
return !strcmp(mydir, mnt.mnt_dir) && !strcmp(myfsname, mnt.mnt_fsname);
+#endif
}
void