summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBaoshanPang <pangbw@gmail.com>2019-11-04 15:15:49 -0800
committerBaoshanPang <pangbw@gmail.com>2019-11-22 14:36:53 -0800
commite20f630f1caf7e95a725ed524109fc168a9e1345 (patch)
tree750976eab912e2a184ff0d4c13f2ccdf5027f345
parentAuto merge of #66558 - Aaron1011:update/miri-unwind, r=RalfJung (diff)
downloadrust-e20f630f1caf7e95a725ed524109fc168a9e1345.tar.gz
rust-e20f630f1caf7e95a725ed524109fc168a9e1345.tar.bz2
rust-e20f630f1caf7e95a725ed524109fc168a9e1345.tar.xz
pass the captured environment variables to rtpSpawn
-rw-r--r--src/libstd/sys/vxworks/process/process_vxworks.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/sys/vxworks/process/process_vxworks.rs b/src/libstd/sys/vxworks/process/process_vxworks.rs
index 7446471..1ec318e 100644
--- a/src/libstd/sys/vxworks/process/process_vxworks.rs
+++ b/src/libstd/sys/vxworks/process/process_vxworks.rs
@@ -15,6 +15,7 @@ impl Command {
15 -> io::Result<(Process, StdioPipes)> { 15 -> io::Result<(Process, StdioPipes)> {
16 use crate::sys::{cvt_r}; 16 use crate::sys::{cvt_r};
17 const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX"; 17 const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
18 let envp = self.capture_env();
18 19
19 if self.saw_nul() { 20 if self.saw_nul() {
20 return Err(io::Error::new(ErrorKind::InvalidInput, 21 return Err(io::Error::new(ErrorKind::InvalidInput,
@@ -52,10 +53,13 @@ impl Command {
52 t!(cvt(libc::chdir(cwd.as_ptr()))); 53 t!(cvt(libc::chdir(cwd.as_ptr())));
53 } 54 }
54 55
56 let c_envp = envp.as_ref().map(|c| c.as_ptr())
57 .unwrap_or_else(|| *sys::os::environ() as *const _);
58
55 let ret = libc::rtpSpawn( 59 let ret = libc::rtpSpawn(
56 self.get_argv()[0], // executing program 60 self.get_argv()[0], // executing program
57 self.get_argv().as_ptr() as *mut *const c_char, // argv 61 self.get_argv().as_ptr() as *mut *const c_char, // argv
58 *sys::os::environ() as *mut *const c_char, 62 c_envp as *mut *const c_char,
59 100 as c_int, // initial priority 63 100 as c_int, // initial priority
60 thread::min_stack(), // initial stack size. 64 thread::min_stack(), // initial stack size.
61 0, // options 65 0, // options