summaryrefslogtreecommitdiffstats
path: root/contrib/fuse-lib/mount-common.c
diff options
context:
space:
mode:
authorHarshavardhana <harsha@harshavardhana.net>2014-06-21 02:00:23 -0700
committergluster-ant <bugzilla-bot@gluster.org>2014-06-21 02:00:23 -0700
commitf456fa84da0e6ecafb0f6428fae75c934c2058d9 (patch)
tree9d738c29062ae78e90a5da95ad454f2d81ff7755 /contrib/fuse-lib/mount-common.c
parent838da96ab0c2e0861d7e38e19fa4518b905b79d9 (diff)
downloadglusterfs-f456fa84da0e6ecafb0f6428fae75c934c2058d9.tar.gz
glusterfs-f456fa84da0e6ecafb0f6428fae75c934c2058d9.tar.xz
glusterfs-f456fa84da0e6ecafb0f6428fae75c934c2058d9.zip
porting: Port for FreeBSD rebased from Mike Ma's efforts
- Provides a working Gluster Management Daemon, CLI - Provides a working GlusterFS server, GlusterNFS server - Provides a working GlusterFS client - execinfo port from FreeBSD is moved into ./contrib/libexecinfo for ease of portability on NetBSD. (FreeBSD 10 and OSX provide execinfo natively) - More portability cleanups for Darwin, FreeBSD and NetBSD - Provides a new rc script for FreeBSD Change-Id: I8dff336f97479ca5a7f9b8c6b730051c0f8ac46f BUG: 1111774 Original-Author: Mike Ma <mikemandarine@gmail.com> Signed-off-by: Harshavardhana <harsha@harshavardhana.net> Reviewed-on: http://review.gluster.org/8141 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'contrib/fuse-lib/mount-common.c')
-rw-r--r--contrib/fuse-lib/mount-common.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/contrib/fuse-lib/mount-common.c b/contrib/fuse-lib/mount-common.c
index fd6cce44e3..cd226fa314 100644
--- a/contrib/fuse-lib/mount-common.c
+++ b/contrib/fuse-lib/mount-common.c
@@ -23,7 +23,7 @@
* see the commit log and per-function comments.
*/
-#ifndef __NetBSD__
+#ifdef GF_LINUX_HOST_OS
/* FUSE: cherry-picked bd99f9cf */
static int
mtab_needs_update (const char *mnt)
@@ -69,9 +69,9 @@ mtab_needs_update (const char *mnt)
return 1;
}
-#else /* __NetBSD__ */
+#else /* GF_LINUX_HOST_OS */
#define mtab_needs_update(x) 1
-#endif /* __NetBSD__ */
+#endif /* GF_LINUX_HOST_OS */
/* FUSE: called add_mount_legacy(); R.I.P. as of cbd3a2a8 */
int
@@ -246,10 +246,17 @@ fuse_mnt_umount (const char *progname, const char *abs_mnt,
if (res == 0) {
sigprocmask (SIG_SETMASK, &oldmask, NULL);
setuid (geteuid ());
+#ifdef GF_LINUX_HOST_OS
execl ("/bin/umount", "/bin/umount", "-i", rel_mnt,
- lazy ? "-l" : NULL, NULL);
+ lazy ? "-l" : NULL, NULL);
GFFUSE_LOGERR ("%s: failed to execute /bin/umount: %s",
progname, strerror (errno));
+#else
+ execl ("/sbin/umount", "/sbin/umount", rel_mnt,
+ lazy ? "-l" : NULL, NULL);
+ GFFUSE_LOGERR ("%s: failed to execute /sbin/umount: %s",
+ progname, strerror (errno));
+#endif /* GF_LINUX_HOST_OS */
exit (1);
}
res = waitpid (res, &status, 0);