summaryrefslogtreecommitdiffstats
path: root/contrib/fuse-lib
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2011-05-30 04:18:00 +0000
committerAnand Avati <avati@gluster.com>2011-05-30 04:48:34 -0700
commit291588c6d912e137ef4d8c19d0447e43c7d87bc4 (patch)
tree9d3c859ffa352181cb86e15b64f0c751460cadc1 /contrib/fuse-lib
parentf2e0b36ea6d31a09f4013b2e6f6ffccc4aca9c0b (diff)
fuse: NetBSD portability fixes
On NetBSD use libperfuse(3), rename umount2(2) as unmount(2), and skip inexistant /etc/mtab management. Thanks to: Emmanuel Dreyfus <manu@netbsd.org> Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2923 (NetBSD port) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2923
Diffstat (limited to 'contrib/fuse-lib')
-rw-r--r--contrib/fuse-lib/mount.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index f922b07d4..85a366894 100644
--- a/contrib/fuse-lib/mount.c
+++ b/contrib/fuse-lib/mount.c
@@ -20,7 +20,9 @@
#include <fcntl.h>
#include <errno.h>
#include <dirent.h>
+#ifndef __NetBSD__
#include <mntent.h>
+#endif /* __NetBSD__ */
#include <sys/stat.h>
#include <sys/poll.h>
#include <sys/socket.h>
@@ -28,6 +30,11 @@
#include <sys/wait.h>
#include <sys/mount.h>
+#ifdef __NetBSD__
+#include <perfuse.h>
+#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
+#endif
+
#ifdef FUSE_UTIL
#define MALLOC(size) malloc (size)
#define FREE(ptr) free (ptr)
@@ -58,6 +65,7 @@
* - there are some other minor things
*/
+#ifndef __NetBSD__
static int
mtab_needs_update (const char *mnt)
{
@@ -91,6 +99,9 @@ mtab_needs_update (const char *mnt)
return 1;
}
+#else /* __NetBSD__ */
+#define mtab_needs_update(x) 1
+#endif /* __NetBSD__ */
#ifndef FUSE_UTIL
static