Skip to content

Commit 83ee034

Browse files
committed
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.
1 parent a2aba05 commit 83ee034

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

library/std/src/sys/pal/unix/os.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,12 @@ pub fn current_exe() -> io::Result<PathBuf> {
484484
}
485485
}
486486

487-
#[cfg(any(target_os = "redox", target_os = "rtems"))]
487+
#[cfg(target_os = "redox")]
488+
pub fn current_exe() -> io::Result<PathBuf> {
489+
crate::fs::read_to_string("/scheme/sys/exe").map(PathBuf::from)
490+
}
491+
492+
#[cfg(target_os = "rtems")]
488493
pub fn current_exe() -> io::Result<PathBuf> {
489494
crate::fs::read_to_string("sys:exe").map(PathBuf::from)
490495
}

library/std/src/sys/pal/unix/process/process_common.rs

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use crate::{fmt, io, ptr};
1919
cfg_if::cfg_if! {
2020
if #[cfg(target_os = "fuchsia")] {
2121
// fuchsia doesn't have /dev/null
22-
} else if #[cfg(target_os = "redox")] {
23-
const DEV_NULL: &CStr = c"null:";
2422
} else if #[cfg(target_os = "vxworks")] {
2523
const DEV_NULL: &CStr = c"/null";
2624
} else {

0 commit comments

Comments
 (0)