From 18c1e4dbe101fcd77d810e701412470df8281fcc Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 2 Mar 2004 16:18:30 +0000 Subject: [PATCH] nicer mount parameters --- ChangeLog | 2 ++ lib/helper.c | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 051ab94..b313569 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2004-03-02 Miklos Szeredi + * fuse_main() adds "-n progname" to the fusermount command line + * More kernel interface changes: * Lookup/getattr return cache timeout values diff --git a/lib/helper.c b/lib/helper.c index f2ed9b8..0a4948c 100644 --- a/lib/helper.c +++ b/lib/helper.c @@ -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) -- 2.30.2