about summary refs log tree commit diff
path: root/tvix/store/src/fs/file_attr.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/store/src/fs/file_attr.rs')
-rw-r--r--tvix/store/src/fs/file_attr.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/tvix/store/src/fs/file_attr.rs b/tvix/store/src/fs/file_attr.rs
index b946aa977a0a..562cd9f19002 100644
--- a/tvix/store/src/fs/file_attr.rs
+++ b/tvix/store/src/fs/file_attr.rs
@@ -7,7 +7,7 @@ pub const ROOT_FILE_ATTR: Attr = Attr {
     size: 0,
     blksize: 1024,
     blocks: 0,
-    mode: libc::S_IFDIR | 0o555,
+    mode: libc::S_IFDIR as u32 | 0o555,
     atime: 0,
     mtime: 0,
     ctime: 0,
@@ -19,6 +19,12 @@ pub const ROOT_FILE_ATTR: Attr = Attr {
     gid: 0,
     rdev: 0,
     flags: 0,
+    #[cfg(target_os = "macos")]
+    crtime: 0,
+    #[cfg(target_os = "macos")]
+    crtimensec: 0,
+    #[cfg(target_os = "macos")]
+    padding: 0,
 };
 
 /// for given &Node and inode, construct an [Attr]
@@ -36,10 +42,10 @@ pub fn gen_file_attr(inode_data: &InodeData, inode: u64) -> Attr {
             }
         },
         mode: match inode_data {
-            InodeData::Regular(_, _, false) => libc::S_IFREG | 0o444, // no-executable files
-            InodeData::Regular(_, _, true) => libc::S_IFREG | 0o555,  // executable files
-            InodeData::Symlink(_) => libc::S_IFLNK | 0o444,
-            InodeData::Directory(_) => libc::S_IFDIR | 0o555,
+            InodeData::Regular(_, _, false) => libc::S_IFREG as u32 | 0o444, // no-executable files
+            InodeData::Regular(_, _, true) => libc::S_IFREG as u32 | 0o555,  // executable files
+            InodeData::Symlink(_) => libc::S_IFLNK as u32 | 0o444,
+            InodeData::Directory(_) => libc::S_IFDIR as u32 | 0o555,
         },
         ..Default::default()
     }