diff options
| author | Jeremy Soller <jeremy@system76.com> | 2019-04-07 08:39:54 -0600 | 
|---|---|---|
| committer | Jeremy Soller <jeremy@system76.com> | 2019-08-06 16:18:23 -0600 | 
| commit | 0498da9a3dc061f604fcfb9b56bd889e07f2b7e2 (patch) | |
| tree | c297dc9d51cd63c0a1297426ae3633e3921dcb44 /src/libstd/sys/unix/process/process_common.rs | |
| parent | 6a91782b72fca586b15ba68364bc7baab837af86 (diff) | |
| download | rust-0498da9a3dc061f604fcfb9b56bd889e07f2b7e2.tar.gz rust-0498da9a3dc061f604fcfb9b56bd889e07f2b7e2.zip | |
redox: convert to target_family unix
Diffstat (limited to 'src/libstd/sys/unix/process/process_common.rs')
| -rw-r--r-- | src/libstd/sys/unix/process/process_common.rs | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index 3ff4f194cd1..9f81c67b477 100644 --- a/src/libstd/sys/unix/process/process_common.rs +++ b/src/libstd/sys/unix/process/process_common.rs @@ -12,6 +12,14 @@ use crate::collections::BTreeMap; use libc::{c_int, gid_t, uid_t, c_char, EXIT_SUCCESS, EXIT_FAILURE}; +cfg_if! { + if #[cfg(target_os = "redox")] { + const DEV_NULL: &'static str = "null:\0"; + } else { + const DEV_NULL: &'static str = "/dev/null\0"; + } +} + //////////////////////////////////////////////////////////////////////////////// // Command //////////////////////////////////////////////////////////////////////////////// @@ -298,7 +306,7 @@ impl Stdio { opts.read(readable); opts.write(!readable); let path = unsafe { - CStr::from_ptr("/dev/null\0".as_ptr() as *const _) + CStr::from_ptr(DEV_NULL.as_ptr() as *const _) }; let fd = File::open_c(&path, &opts)?; Ok((ChildStdio::Owned(fd.into_fd()), None)) | 
