aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/9pfuse
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2007-11-27 15:39:06 -0500
committerRuss Cox <rsc@swtch.com>2007-11-27 15:39:06 -0500
commit83ab7d88962d717ca5729e7337706b6e4da48af6 (patch)
tree2dcaeba8fec383733357f4db5e9c2d0718767838 /src/cmd/9pfuse
parent00a8743cd85fcb605a06382387ac526e7fe8bf36 (diff)
parent00a8743cd85fcb605a06382387ac526e7fe8bf36 (diff)
downloadplan9port-83ab7d88962d717ca5729e7337706b6e4da48af6.tar.gz
plan9port-83ab7d88962d717ca5729e7337706b6e4da48af6.tar.bz2
plan9port-83ab7d88962d717ca5729e7337706b6e4da48af6.zip
merge
Diffstat (limited to 'src/cmd/9pfuse')
-rw-r--r--src/cmd/9pfuse/fuse.c11
-rw-r--r--src/cmd/9pfuse/main.c19
2 files changed, 24 insertions, 6 deletions
diff --git a/src/cmd/9pfuse/fuse.c b/src/cmd/9pfuse/fuse.c
index b1210b7b..e78bae88 100644
--- a/src/cmd/9pfuse/fuse.c
+++ b/src/cmd/9pfuse/fuse.c
@@ -804,6 +804,8 @@ mountfuse(char *mtpt)
"/Contents/Resources/load_fusefs", 0) < 0 &&
access(f="/Library/Extensions/fusefs.kext"
"/Contents/Resources/load_fusefs", 0) < 0 &&
+ access(f="/Library/Filesystems"
+ "/fusefs.fs/Support/load_fusefs", 0) < 0 &&
access(f="/System/Library/Filesystems"
"/fusefs.fs/Support/load_fusefs", 0) < 0){
werrstr("cannot find load_fusefs");
@@ -843,8 +845,15 @@ mountfuse(char *mtpt)
/*
* Different versions of MacFUSE put the
* mount_fusefs binary in different places.
- * Try both.
+ * Try all.
*/
+ /* Leopard location */
+ putenv("MOUNT_FUSEFS_DAEMON_PATH",
+ "/Library/Filesystems/fusefs.fs/Support/mount_fusefs");
+ execl("/Library/Filesystems/fusefs.fs/Support/mount_fusefs",
+ "mount_fusefs", buf, mtpt, nil);
+
+ /* possible Tiger locations */
execl("/System/Library/Filesystems/fusefs.fs/mount_fusefs",
"mount_fusefs", buf, mtpt, nil);
execl("/System/Library/Filesystems/fusefs.fs/Support/mount_fusefs",
diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c
index 82d7b1fe..50c835bb 100644
--- a/src/cmd/9pfuse/main.c
+++ b/src/cmd/9pfuse/main.c
@@ -22,12 +22,21 @@
#ifndef O_DIRECTORY
#define O_DIRECTORY 0
#endif
+
#ifndef O_LARGEFILE
-#if defined(__linux__)
-#define O_LARGEFILE 0100000 /* Sigh */
-#else
-#define O_LARGEFILE 0
+# if defined(__linux__)
+# define O_LARGEFILE 0100000 /* Sigh */
+# else
+# define O_LARGEFILE 0
+# endif
#endif
+
+#ifndef O_CLOEXEC
+# if defined(__linux__)
+# define O_CLOEXEC 02000000 /* Sigh */
+# else
+# define O_CLOEXEC 0
+# endif
#endif
@@ -552,7 +561,7 @@ _fuseopen(FuseMsg *m, int isdir)
flags = in->flags;
openmode = flags&3;
flags &= ~3;
- flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE);
+ flags &= ~(O_DIRECTORY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC);
if(flags & O_TRUNC){
openmode |= OTRUNC;
flags &= ~O_TRUNC;