1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
$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
|