From d6333f160b67247d152bb4546bef18c1fe4085fc Mon Sep 17 00:00:00 2001 From: Dmitrii Kuminov Date: Mon, 6 Jul 2026 18:34:03 -0700 Subject: [PATCH] macOS: do not call fuse_session_fd before fuse_daemonise This prevents forking on macFUSE 5.3.3+ so that sshfs continues to run in foreground. According to macFUSE maintainer, this call is not needed with recent macFUSE at all. See #373 for more info. --- sshfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sshfs.c b/sshfs.c index c97f66d..a9df0f5 100644 --- a/sshfs.c +++ b/sshfs.c @@ -4518,7 +4518,7 @@ int main(int argc, char *argv[]) exit(1); } -#if !defined(__CYGWIN__) +#if !defined(__CYGWIN__) && !defined(__APPLE__) res = fcntl(fuse_session_fd(se), F_SETFD, FD_CLOEXEC); if (res == -1) perror("WARNING: failed to set FD_CLOEXEC on fuse device");