aboutsummaryrefslogtreecommitdiff
path: root/lib/mount.c
diff options
context:
space:
mode:
authorMiklos Szeredi <miklos@szeredi.hu>2005-07-21 07:59:37 +0000
committerMiklos Szeredi <miklos@szeredi.hu>2005-07-21 07:59:37 +0000
commit9b813af8631729cf7f626f0cbac08863bb315863 (patch)
tree1ccd7493b978e83e85f27063d88045dbdddec7bb /lib/mount.c
parente2aa2e243d729e29ad67f1b30aa3392ca9a9cdb2 (diff)
downloadlibfuse-9b813af8631729cf7f626f0cbac08863bb315863.tar.gz
fixes
Diffstat (limited to 'lib/mount.c')
-rw-r--r--lib/mount.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/lib/mount.c b/lib/mount.c
index 86ad2be..01081bb 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -72,8 +72,8 @@ void fuse_unmount(const char *mountpoint)
const char *mountprog = FUSERMOUNT_PROG;
char umount_cmd[1024];
- snprintf(umount_cmd, sizeof(umount_cmd) - 1, "%s -u -q -z %s", mountprog,
- mountpoint);
+ snprintf(umount_cmd, sizeof(umount_cmd) - 1, "%s -u -q -z -- %s",
+ mountprog, mountpoint);
umount_cmd[sizeof(umount_cmd) - 1] = '\0';
system(umount_cmd);
@@ -106,8 +106,17 @@ int fuse_mount(const char *mountpoint, const char *opts)
if(pid == 0) {
char env[10];
- const char *argv[] = {mountprog, opts ? "-o" : mountpoint, opts,
- mountpoint, NULL};
+ const char *argv[32];
+ int a = 0;
+
+ argv[a++] = mountprog;
+ if (opts) {
+ argv[a++] = "-o";
+ argv[a++] = opts;
+ }
+ argv[a++] = "--";
+ argv[a++] = mountpoint;
+ argv[a++] = NULL;
close(fds[1]);
fcntl(fds[0], F_SETFD, 0);