diff options
author | Anand Avati <avati@gluster.com> | 2011-05-30 04:18:00 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-05-30 04:48:34 -0700 |
commit | 291588c6d912e137ef4d8c19d0447e43c7d87bc4 (patch) | |
tree | 9d3c859ffa352181cb86e15b64f0c751460cadc1 | |
parent | f2e0b36ea6d31a09f4013b2e6f6ffccc4aca9c0b (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
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | contrib/fuse-lib/mount.c | 11 | ||||
-rw-r--r-- | libglusterfs/src/compat-errno.c | 6 |
3 files changed, 14 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 9d416aa3f60..9ff9e474d79 100644 --- a/configure.ac +++ b/configure.ac @@ -394,7 +394,6 @@ AC_SUBST(GF_DISTRIBUTION) GF_HOST_OS="" GF_LDFLAGS="-rdynamic" -GF_FUSE_LDADD="-lfuse" case $host_os in linux*) dnl GF_LINUX_HOST_OS=1 diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c index f922b07d44b..85a36689422 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 diff --git a/libglusterfs/src/compat-errno.c b/libglusterfs/src/compat-errno.c index 55bf198a091..d57c0f968a4 100644 --- a/libglusterfs/src/compat-errno.c +++ b/libglusterfs/src/compat-errno.c @@ -567,7 +567,7 @@ init_compat_errno_arrays () gf_error_to_errno_array[GF_ERROR_CODE_BADMACHO] = EBADMACHO; gf_errno_to_error_array[EBADMACHO] = GF_ERROR_CODE_BADMACHO; -#if 0 +#ifdef EDOOFUS /* EDOOFUS 88 / * Programming error */ gf_error_to_errno_array[GF_ERROR_CODE_DOOFUS] = EDOOFUS; gf_errno_to_error_array[EDOOFUS] = GF_ERROR_CODE_DOOFUS; @@ -858,11 +858,11 @@ init_compat_errno_arrays () gf_error_to_errno_array[GF_ERROR_CODE_NOATTR] = ENOATTR; gf_errno_to_error_array[ENOATTR] = GF_ERROR_CODE_NOATTR; -#ifndef __NetBSD__ /* Undefined on NetBSD */ +#ifdef EDOOFUS /* EDOOFUS 88 / * Programming error */ gf_error_to_errno_array[GF_ERROR_CODE_DOOFUS] = EDOOFUS; gf_errno_to_error_array[EDOOFUS] = GF_ERROR_CODE_DOOFUS; -#endif /* __NetBSD__ */ +#endif /* EBADMSG 89 / * Bad message */ gf_error_to_errno_array[GF_ERROR_CODE_BADMSG] = EBADMSG; |