From 970e47d30cce50dad0165392ffcc18f9f6b9b2eb Mon Sep 17 00:00:00 2001 From: vasilito Date: Wed, 8 Jul 2026 20:11:43 +0300 Subject: [PATCH] fix(tlc): repair redox scheme VFS backend compilation - Add redox_syscall path dependency for the Redox-only scheme backend. - Fix RedoxStat import to use redox_syscall::data::Stat. - Match Entry API: Entry { name, stat } and is_dir() method. - Match Stat API: nlinks/inode fields, Permissions::from_mode. --- local/recipes/tui/tlc/source/Cargo.toml | 2 ++ .../tui/tlc/source/src/vfs/redox_scheme.rs | 25 ++++++------------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/local/recipes/tui/tlc/source/Cargo.toml b/local/recipes/tui/tlc/source/Cargo.toml index 407b6fa5f7..a2a9d93a3c 100644 --- a/local/recipes/tui/tlc/source/Cargo.toml +++ b/local/recipes/tui/tlc/source/Cargo.toml @@ -76,6 +76,8 @@ suppaftp = { version = "6", optional = true } tar = { version = "0.4", optional = true } zip = { version = "2", default-features = false, optional = true } +redox_syscall = { path = "../../../../local/sources/syscall" } + # Syntax highlighting syntect = { version = "5", default-features = false, features = ["default-onig", "regex-onig"], optional = true } diff --git a/local/recipes/tui/tlc/source/src/vfs/redox_scheme.rs b/local/recipes/tui/tlc/source/src/vfs/redox_scheme.rs index e183159d1e..13e065e456 100644 --- a/local/recipes/tui/tlc/source/src/vfs/redox_scheme.rs +++ b/local/recipes/tui/tlc/source/src/vfs/redox_scheme.rs @@ -23,7 +23,7 @@ use std::io::{self, Read}; use std::path::PathBuf; use redox_syscall::flag::{O_RDONLY, O_DIRECTORY, O_STAT}; -use redox_syscall::{self, Stat as RedoxStat}; +use redox_syscall::data::Stat as RedoxStat; use crate::fs::{FileType, Permissions, Stat}; use crate::vfs::local::Entry; @@ -70,20 +70,15 @@ impl RedoxSchemeVfs { }; Stat { file_type, - permissions: Permissions { - mode: (rs.st_mode & 0o7777) as u16, - }, - size: rs.st_size as u64, + permissions: Permissions::from_mode((rs.st_mode & 0o7777) as u32), + size: rs.st_size, mtime: rs.st_mtime as i64, atime: rs.st_atime as i64, ctime: rs.st_ctime as i64, uid: rs.st_uid, gid: rs.st_gid, - nlink: rs.st_nlink as u64, - dev: rs.st_dev as u64, - ino: rs.st_ino, - blksize: rs.st_blksize as u64, - blocks: rs.st_blocks as u64, + nlinks: rs.st_nlink as u64, + inode: rs.st_ino, } } } @@ -131,18 +126,14 @@ impl Vfs for RedoxSchemeVfs { }; entries.push(Entry { name, - size: stat.size, - modified: stat.mtime, - is_dir: stat.file_type == FileType::Directory, - is_symlink: stat.file_type == FileType::Symlink, - permissions: stat.permissions, + stat, }); } } let _ = redox_syscall::close(fd); entries.sort_by(|a, b| { - b.is_dir - .cmp(&a.is_dir) + b.is_dir() + .cmp(&a.is_dir()) .then_with(|| a.name.to_lowercase().cmp(&b.name.to_lowercase())) }); Ok(entries)