nicer mount parameters
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 2 Mar 2004 16:18:30 +0000 (16:18 +0000)
committerMiklos Szeredi <miklos@szeredi.hu>
Tue, 2 Mar 2004 16:18:30 +0000 (16:18 +0000)
ChangeLog
lib/helper.c

index 051ab946e621223f34e1af2e702263b9e4eb14c7..b31356927ec3a76d6ab88e0ae0878e9247dac1b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2004-03-02  Miklos Szeredi <mszeredi@inf.bme.hu>
 
+       * fuse_main() adds "-n progname" to the fusermount command line
+       
        * More kernel interface changes:
 
        * Lookup/getattr return cache timeout values
index f2ed9b82719f27513f644bae9fccde2a1faada95..0a4948cdefb277be77052e786a280f6040bb0f9a 100644 (file)
@@ -81,6 +81,8 @@ void fuse_main(int argc, char *argv[], const struct fuse_operations *op)
     int fuse_fd;
     char *fuse_mountpoint = NULL;
     char **fusermount_args = NULL;
+    char *newargs[3];
+    char *basename;
     
     flags = 0;
     multithreaded = 1;
@@ -119,6 +121,21 @@ void fuse_main(int argc, char *argv[], const struct fuse_operations *op)
         fprintf(stderr, "missing mountpoint\n");
         usage(argv[0]);
     }
+    if(fusermount_args != NULL)
+        fusermount_args -= 2; /* Hack! */
+    else {
+        fusermount_args = newargs;
+        fusermount_args[2] = NULL;
+    }
+    
+    basename = strrchr(argv[0], '/');
+    if(basename == NULL)
+        basename = argv[0];
+    else if(basename[1] != '\0')
+        basename++;
+
+    fusermount_args[0] = "-n";
+    fusermount_args[1] = basename;
 
     fuse_fd = fuse_mount(fuse_mountpoint, (const char **) fusermount_args);
     if(fuse_fd == -1)