@@ -5,15 +5,15 @@ index 6ed4444..b592ade 100644
55@@ -46,7 +46,6 @@
66 #define umount2(mnt, flags) unmount(mnt, (flags == 2) ? MNT_FORCE : 0)
77 #endif
8-
8+
99- #define FUSERMOUNT_PROG "fusermount3"
1010 #define FUSE_COMMFD_ENV "_FUSE_COMMFD"
1111 #define FUSE_COMMFD2_ENV "_FUSE_COMMFD2"
12-
12+
1313@@ -121,6 +120,34 @@ static const struct fuse_opt fuse_mount_opts[] = {
1414 FUSE_OPT_END
1515 };
16-
16+
1717+ /**
1818+ * Returns FUSERMOUNT_PROG path from environment variable.
1919+ *
@@ -51,9 +51,9 @@ index 6ed4444..b592ade 100644
5151 {
5252- const char *full_path = FUSERMOUNT_DIR "/" FUSERMOUNT_PROG;
5353 pid_t pid;
54-
54+
5555 /* See man 7 environ for the global environ pointer */
56-
56+
5757- /* first try the install path */
5858- int status = posix_spawn(&pid, full_path, action, NULL,
5959+ int status = posix_spawn(&pid, fusermountProg(), action, NULL,
@@ -63,27 +63,27 @@ index 6ed4444..b592ade 100644
6363- status = posix_spawnp(&pid, FUSERMOUNT_PROG, action, NULL,
6464- (char * const *) argv, environ);
6565- }
66-
66+
6767 if (status != 0) {
6868 fuse_log(FUSE_LOG_ERR,
6969@@ -160,12 +180,12 @@ static int fusermount_posix_spawn(posix_spawn_file_actions_t *action,
70-
70+
7171 void fuse_mount_version(void)
7272 {
7373- char const *const argv[] = {FUSERMOUNT_PROG, "--version", NULL};
7474+ char const *const argv[] = {fusermountProg(), "--version", NULL};
7575 int status = fusermount_posix_spawn(NULL, argv, NULL);
76-
76+
7777 if(status != 0)
7878 fuse_log(FUSE_LOG_ERR, "Running '%s --version' failed",
7979- FUSERMOUNT_PROG);
8080+ fusermountProg());
8181 }
82-
82+
8383 struct mount_flags {
8484@@ -337,12 +357,12 @@ void fuse_kern_unmount(const char *mountpoint, int fd)
8585 return;
86-
86+
8787 char const * const argv[] =
8888- { FUSERMOUNT_PROG, "--unmount", "--quiet", "--lazy",
8989+ { fusermountProg(), "--unmount", "--quiet", "--lazy",
@@ -98,7 +98,7 @@ index 6ed4444..b592ade 100644
9898 }
9999@@ -378,7 +398,7 @@ static int setup_auto_unmount(const char *mountpoint, int quiet)
100100 setenv(FUSE_COMMFD2_ENV, arg_fd_entry, 1);
101-
101+
102102 char const *const argv[] = {
103103- FUSERMOUNT_PROG,
104104+ fusermountProg(),
@@ -113,10 +113,10 @@ index 6ed4444..b592ade 100644
113113+ fusermountProg(), strerror(errno));
114114 return -1;
115115 }
116-
116+
117117@@ -451,7 +471,7 @@ static int fuse_mount_fusermount(const char *mountpoint, struct mount_opts *mo,
118118 setenv(FUSE_COMMFD2_ENV, arg_fd_entry, 1);
119-
119+
120120 char const *const argv[] = {
121121- FUSERMOUNT_PROG,
122122+ fusermountProg(),
@@ -131,4 +131,3 @@ index 6ed4444..b592ade 100644
131131+ fusermountProg(), strerror(-status));
132132 return -1;
133133 }
134-
0 commit comments