Fixed block/char/fifo types

This commit is contained in:
Caleb Gardner
2025-05-25 06:33:03 -05:00
parent dd452060cb
commit c4e2dab3f7
+4 -7
View File
@@ -231,13 +231,10 @@ pub const File = struct {
.block, .ext_block, .char, .ext_char, .fifo, .ext_fifo => { .block, .ext_block, .char, .ext_char, .fifo, .ext_fifo => {
if (exists) return ExtractError.FileExists; if (exists) return ExtractError.FileExists;
comptime if (builtin.os.tag != .linux) return; comptime if (builtin.os.tag != .linux) return;
const IFCHR: u32 = 0o020000; const mode: u32 = switch (self.inode.header.inode_type) {
const IFBLK: u32 = 0o060000; .block, .ext_block => std.posix.S.IFBLK,
const IFIFO: u32 = 0o010000; .char, .ext_char => std.posix.S.IFCHR,
const mode = switch (self.inode.header.inode_type) { .fifo, .ext_fifo => std.posix.S.IFIFO,
.block, .ext_block => IFBLK,
.char, .ext_char => IFCHR,
.fifo, .ext_fifo => IFIFO,
else => unreachable, else => unreachable,
}; };
const dev = switch (self.inode.data) { const dev = switch (self.inode.data) {