diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-07-30 22:43:36 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-30 22:43:36 +0200 |
| commit | cdf97589df2de0d5e877dac43d0ec6089c20fb11 (patch) | |
| tree | 7cc2b048010ae85717c45995f203a69b32ab09a5 /src/libstd/sys/vxworks | |
| parent | dbf54ad324e4b788a77f594824792ae5cab36eeb (diff) | |
| parent | f6906ba11b1d8148892aec733e8c7dd147ccc565 (diff) | |
| download | rust-cdf97589df2de0d5e877dac43d0ec6089c20fb11.tar.gz rust-cdf97589df2de0d5e877dac43d0ec6089c20fb11.zip | |
Rollup merge of #63117 - BaoshanPang:bugfix, r=alexcrichton
Use global variable 'environ' to pass environments to rtpSpawn r? @alexcrichton
Diffstat (limited to 'src/libstd/sys/vxworks')
| -rw-r--r-- | src/libstd/sys/vxworks/process/process_vxworks.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs index d06d63bb43d..b07966fa206 100644 --- a/src/libstd/sys/vxworks/process/process_vxworks.rs +++ b/src/libstd/sys/vxworks/process/process_vxworks.rs @@ -1,7 +1,7 @@ use crate::io::{self, Error, ErrorKind}; -use libc::{self, c_int}; +use libc::{self, c_int, c_char}; use libc::{RTP_ID}; - +use crate::sys; use crate::sys::cvt; use crate::sys::process::rtp; use crate::sys::process::process_common::*; @@ -16,8 +16,6 @@ impl Command { use crate::sys::{cvt_r}; const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX"; - let envp = self.capture_env(); - if self.saw_nul() { return Err(io::Error::new(ErrorKind::InvalidInput, "nul byte found in provided data")); @@ -54,19 +52,10 @@ impl Command { t!(cvt(libc::chdir(cwd.as_ptr()))); } - // let envp = envp.map(|c| c.as_ptr()) - // .unwrap_or(*sys::os::environ() as *const _); - // FIXME: https://github.com/rust-lang/rust/issues/61993 - let envp_empty = CStringArray::with_capacity(0); - let envp = match envp { - Some(x) => x, - None => envp_empty, - }; - let envp = envp.as_ptr(); let ret = rtp::rtpSpawn( self.get_argv()[0], // executing program self.get_argv().as_ptr() as *const _, // argv - envp as *const _, // environment variable pointers + *sys::os::environ() as *const *const c_char, 100 as c_int, // initial priority 0x16000, // initial stack size. 0 defaults // to 0x4000 in 32 bit and 0x8000 in 64 bit |
