summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2011-11-24 06:32:36 +0100
committerAnand Avati <avati@gluster.com>2011-11-23 23:48:09 -0800
commit8b8459b5ee5d3bd2dbbf416e12a1be0cd90c270f (patch)
tree855a95b24fa04ee4aa05251072115f3f7e5eb5c3
parentb21d430729c45990492703145c075940e6b1c681 (diff)
Use /bin/mount on Linux, /sbin/mount on other systems
Change-Id: I8d2e518d29cedb1fbfa77d0189a2d4a24957e662 BUG: 2923 Reviewed-on: http://review.gluster.com/752 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amar@gluster.com> Reviewed-by: Anand Avati <avati@gluster.com>
-rw-r--r--contrib/fuse-lib/mount.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/fuse-lib/mount.c b/contrib/fuse-lib/mount.c
index 85a366894..ef89f0ea1 100644
--- a/contrib/fuse-lib/mount.c
+++ b/contrib/fuse-lib/mount.c
@@ -35,6 +35,12 @@
#define umount2(dir, flags) unmount(dir, ((flags) != 0) ? MNT_FORCE : 0)
#endif
+#ifdef linux
+#define _PATH_MOUNT "/bin/mount"
+#else /* NetBSD, MacOS X */
+#define _PATH_MOUNT "/sbin/mount"
+#endif
+
#ifdef FUSE_UTIL
#define MALLOC(size) malloc (size)
#define FREE(ptr) free (ptr)
@@ -174,10 +180,10 @@ fuse_mnt_add_mount (const char *progname, const char *fsname,
exit (1);
}
rmdir (tmp);
- execl ("/bin/mount", "/bin/mount", "-i", "-f", "-t", type,
+ execl (_PATH_MOUNT, _PATH_MOUNT, "-i", "-f", "-t", type,
"-o", opts, fsname, mnt, NULL);
- GFFUSE_LOGERR ("%s: failed to execute /bin/mount: %s",
- progname, strerror (errno));
+ GFFUSE_LOGERR ("%s: failed to execute %s: %s",
+ progname, _PATH_MOUNT, strerror (errno));
exit (1);
}
if (mtab_pid) {