about summary refs log tree commit diff
path: root/tvix/store/src/fs/fuse.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/fs/fuse.rs')
-rw-r--r--tvix/store/src/fs/fuse.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/tvix/store/src/fs/fuse.rs b/tvix/store/src/fs/fuse.rs
index 8535c78584..d2a7348821 100644
--- a/tvix/store/src/fs/fuse.rs
+++ b/tvix/store/src/fs/fuse.rs
@@ -11,6 +11,11 @@ where
     channel: fuse_backend_rs::transport::FuseChannel,
 }
 
+#[cfg(target_os = "macos")]
+const BADFD: libc::c_int = libc::EBADF;
+#[cfg(target_os = "linux")]
+const BADFD: libc::c_int = libc::EBADFD;
+
 impl<FS> FuseServer<FS>
 where
     FS: FileSystem + Sync + Send,
@@ -29,7 +34,7 @@ where
                     match e {
                         // This indicates the session has been shut down.
                         fuse_backend_rs::Error::EncodeMessage(e)
-                            if e.raw_os_error() == Some(libc::EBADFD) =>
+                            if e.raw_os_error() == Some(BADFD) =>
                         {
                             break;
                         }
@@ -63,6 +68,7 @@ impl FuseDaemon {
         let mut session = FuseSession::new(mountpoint.as_ref(), "tvix-store", "", true)
             .map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;
 
+        #[cfg(target_os = "linux")]
         session.set_allow_other(false);
         session
             .mount()