Skip to content

Commit ed566f7

Browse files
committed
call fuse_daemonize before fuse_mount
This appears to be the right sequence and also fixes ObjC/fork issues on macOS with macFUSE 5.2.0+ (see #373).
1 parent 8bf7f92 commit ed566f7

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

sshfs.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4512,6 +4512,12 @@ int main(int argc, char *argv[])
45124512
exit(1);
45134513
}
45144514

4515+
res = fuse_daemonize(sshfs.foreground);
4516+
if (res == -1) {
4517+
fuse_destroy(fuse);
4518+
exit(1);
4519+
}
4520+
45154521
res = fuse_mount(fuse, sshfs.mountpoint);
45164522
if (res != 0) {
45174523
fuse_destroy(fuse);
@@ -4535,13 +4541,6 @@ int main(int argc, char *argv[])
45354541
exit(1);
45364542
}
45374543

4538-
res = fuse_daemonize(sshfs.foreground);
4539-
if (res == -1) {
4540-
fuse_unmount(fuse);
4541-
fuse_destroy(fuse);
4542-
exit(1);
4543-
}
4544-
45454544
if (sshfs.singlethread)
45464545
res = fuse_loop(fuse);
45474546
else

0 commit comments

Comments
 (0)