From 8b8459b5ee5d3bd2dbbf416e12a1be0cd90c270f Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Thu, 24 Nov 2011 06:32:36 +0100 Subject: 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 Reviewed-by: Amar Tumballi Reviewed-by: Anand Avati --- contrib/fuse-lib/mount.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'contrib') 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) { -- cgit