Use RedoxPath::as_parts. redox-path from crates.io

This commit is contained in:
Ron Williams
2024-02-09 15:05:45 +00:00
committed by Jeremy Soller
parent eeee40ae0c
commit 9331452bdb
4 changed files with 8 additions and 7 deletions
Generated
+3 -1
View File
@@ -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"
+1 -1
View File
@@ -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.
Submodule redox-path deleted from 2971b40d34
+4 -4
View File
@@ -84,7 +84,7 @@ pub fn open(raw_path: UserSliceRo, flags: usize) -> Result<FileHandle> {
*/
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();