Remove usage of legacy scheme paths on RedoxOS

The name:/path path syntax is getting phased out in favor of
/scheme/name/path. Also using null: is no longer necessary as /dev/null
is available on Redox OS too.
This commit is contained in:
bjorn3 2025-03-13 16:17:40 +00:00
parent a2aba0578b
commit 83ee034d03
2 changed files with 6 additions and 3 deletions

View File

@ -484,7 +484,12 @@ pub fn current_exe() -> io::Result<PathBuf> {
}
}
#[cfg(any(target_os = "redox", target_os = "rtems"))]
#[cfg(target_os = "redox")]
pub fn current_exe() -> io::Result<PathBuf> {
crate::fs::read_to_string("/scheme/sys/exe").map(PathBuf::from)
}
#[cfg(target_os = "rtems")]
pub fn current_exe() -> io::Result<PathBuf> {
crate::fs::read_to_string("sys:exe").map(PathBuf::from)
}

View File

@ -19,8 +19,6 @@ use crate::{fmt, io, ptr};
cfg_if::cfg_if! {
if #[cfg(target_os = "fuchsia")] {
// fuchsia doesn't have /dev/null
} else if #[cfg(target_os = "redox")] {
const DEV_NULL: &CStr = c"null:";
} else if #[cfg(target_os = "vxworks")] {
const DEV_NULL: &CStr = c"/null";
} else {