From 9331452bdbdc6e1f397dc8b5e3fceeb07d2894f5 Mon Sep 17 00:00:00 2001 From: Ron Williams Date: Fri, 9 Feb 2024 15:05:45 +0000 Subject: [PATCH] Use RedoxPath::as_parts. redox-path from crates.io --- Cargo.lock | 4 +++- Cargo.toml | 2 +- redox-path | 1 - src/syscall/fs.rs | 8 ++++---- 4 files changed, 8 insertions(+), 7 deletions(-) delete mode 160000 redox-path diff --git a/Cargo.lock b/Cargo.lock index 99ea28edd6..8c4a9e5614 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,9 @@ dependencies = [ [[package]] name = "redox-path" -version = "0.1.1" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64072665120942deff5fd5425d6c1811b854f4939e7f1c01ce755f64432bbea7" [[package]] name = "redox_syscall" diff --git a/Cargo.toml b/Cargo.toml index e81263f40f..83f226332f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,7 @@ bitfield = "0.13.2" hashbrown = { version = "0.14.3", default-features = false, features = ["ahash", "inline-more"] } linked_list_allocator = "0.9.0" log = "0.4" -redox-path = { path = "redox-path" } +redox-path = "0.2.0" redox_syscall = { path = "syscall" } slab_allocator = { path = "slab_allocator", optional = true } # FIXME: There is some undefined behavior probably in the kernel, which forces us to use spin 0.9.0 and not 0.9.2. diff --git a/redox-path b/redox-path deleted file mode 160000 index 2971b40d34..0000000000 --- a/redox-path +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 2971b40d3462476bf77c0fdbe6cb0e6368f5c269 diff --git a/src/syscall/fs.rs b/src/syscall/fs.rs index 6dd8b55da0..35da5de752 100644 --- a/src/syscall/fs.rs +++ b/src/syscall/fs.rs @@ -84,7 +84,7 @@ pub fn open(raw_path: UserSliceRo, flags: usize) -> Result { */ let path_buf = copy_path_to_buf(raw_path, PATH_MAX)?; let path = RedoxPath::from_absolute(&path_buf).ok_or(Error::new(EINVAL))?; - let (scheme_name, reference) = path.as_parts(); + let (scheme_name, reference) = path.as_parts().ok_or(Error::new(EINVAL))?; let description = { let (scheme_id, scheme) = { @@ -128,7 +128,7 @@ pub fn rmdir(raw_path: UserSliceRo) -> Result<()> { */ let path_buf = copy_path_to_buf(raw_path, PATH_MAX)?; let path = RedoxPath::from_absolute(&path_buf).ok_or(Error::new(EINVAL))?; - let (scheme_name, reference) = path.as_parts(); + let (scheme_name, reference) = path.as_parts().ok_or(Error::new(EINVAL))?; let scheme = { let schemes = scheme::schemes(); @@ -151,7 +151,7 @@ pub fn unlink(raw_path: UserSliceRo) -> Result<()> { */ let path_buf = copy_path_to_buf(raw_path, PATH_MAX)?; let path = RedoxPath::from_absolute(&path_buf).ok_or(Error::new(EINVAL))?; - let (scheme_name, reference) = path.as_parts(); + let (scheme_name, reference) = path.as_parts().ok_or(Error::new(EINVAL))?; let scheme = { let schemes = scheme::schemes(); @@ -378,7 +378,7 @@ pub fn frename(fd: FileHandle, raw_path: UserSliceRo) -> Result<()> { */ let path_buf = copy_path_to_buf(raw_path, PATH_MAX)?; let path = RedoxPath::from_absolute(&path_buf).ok_or(Error::new(EINVAL))?; - let (scheme_name, reference) = path.as_parts(); + let (scheme_name, reference) = path.as_parts().ok_or(Error::new(EINVAL))?; let (scheme_id, scheme) = { let schemes = scheme::schemes();