tlc: fix Redox scheme backend build; base: fix xhcid syntax error
This commit is contained in:
@@ -150,7 +150,7 @@ serde_yaml = "0.9"
|
||||
[target.'cfg(target_os = "redox")'.dependencies]
|
||||
libredox = { path = "../../../../../local/sources/libredox" }
|
||||
redox_event = "0.4.6"
|
||||
redox_syscall = { path = "../../../../../local/sources/syscall", features = ["std", "userspace"] }
|
||||
redox_syscall = { path = "../../../../../local/sources/syscall", features = ["std"] }
|
||||
redox_termios = "0.1.3"
|
||||
|
||||
[profile.release]
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
use std::io::{self, Read};
|
||||
|
||||
use libredox::call;
|
||||
use syscall::flag::{O_RDONLY, O_DIRECTORY, O_STAT};
|
||||
use syscall::data::Stat as RedoxStat;
|
||||
|
||||
@@ -89,9 +90,7 @@ impl Vfs for RedoxSchemeVfs {
|
||||
|
||||
fn read_dir(&self, p: &VfsPath, show_hidden: bool) -> Result<Vec<Entry>, VfsError> {
|
||||
let path = Self::scheme_path(p)?;
|
||||
let path_c = std::ffi::CString::new(path.clone())
|
||||
.map_err(|e| VfsError::Other(format!("scheme path: {e}")))?;
|
||||
let fd = syscall::open(&path_c, O_RDONLY | O_DIRECTORY | O_STAT, 0)
|
||||
let fd = call::open(path.as_str(), (O_RDONLY | O_DIRECTORY | O_STAT) as i32, 0)
|
||||
.map_err(|e| VfsError::Other(format!("scheme open dir: {e}")))?;
|
||||
let mut entries = Vec::new();
|
||||
let mut buf = vec![0u8; 4096];
|
||||
@@ -112,10 +111,8 @@ impl Vfs for RedoxSchemeVfs {
|
||||
continue;
|
||||
}
|
||||
let child_path = format!("{path}/{name}");
|
||||
let child_c = std::ffi::CString::new(child_path.as_str())
|
||||
.map_err(|_| VfsError::Other("invalid child path".into()))?;
|
||||
let mut rs = RedoxStat::default();
|
||||
let stat_fd = syscall::open(&child_c, O_RDONLY | O_STAT, 0)
|
||||
let stat_fd = call::open(child_path.as_str(), (O_RDONLY | O_STAT) as i32, 0)
|
||||
.map_err(|e| VfsError::Other(format!("scheme stat child: {e}")))?;
|
||||
let stat_result = syscall::fstat(stat_fd, &mut rs);
|
||||
let _ = syscall::close(stat_fd);
|
||||
@@ -151,9 +148,7 @@ impl Vfs for RedoxSchemeVfs {
|
||||
|
||||
fn stat(&self, p: &VfsPath) -> Result<Stat, VfsError> {
|
||||
let path = Self::scheme_path(p)?;
|
||||
let path_c = std::ffi::CString::new(path)
|
||||
.map_err(|e| VfsError::Other(format!("scheme path: {e}")))?;
|
||||
let fd = syscall::open(&path_c, O_RDONLY | O_STAT, 0)
|
||||
let fd = call::open(path.as_str(), (O_RDONLY | O_STAT) as i32, 0)
|
||||
.map_err(|e| VfsError::Other(format!("scheme stat: {e}")))?;
|
||||
let mut rs = RedoxStat::default();
|
||||
syscall::fstat(fd, &mut rs)
|
||||
@@ -176,9 +171,7 @@ impl Vfs for RedoxSchemeVfs {
|
||||
|
||||
fn open_read(&self, p: &VfsPath) -> Result<Box<dyn Read + Send>, VfsError> {
|
||||
let path = Self::scheme_path(p)?;
|
||||
let path_c = std::ffi::CString::new(path.clone())
|
||||
.map_err(|e| VfsError::Other(format!("scheme path: {e}")))?;
|
||||
let fd = syscall::open(&path_c, O_RDONLY, 0)
|
||||
let fd = call::open(path.as_str(), O_RDONLY as i32, 0)
|
||||
.map_err(|e| VfsError::Other(format!("scheme open read: {e}")))?;
|
||||
let mut buf = vec![0u8; fd as usize];
|
||||
let n = syscall::read(fd, &mut buf)
|
||||
|
||||
+1
-1
Submodule local/sources/base updated: efa24228e3...4f5495acc6
Reference in New Issue
Block a user