Skip to content

Commit e20f630

Browse files
committed
pass the captured environment variables to rtpSpawn
1 parent 5fa0af2 commit e20f630

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libstd/sys/vxworks/process/process_vxworks.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ impl Command {
1515
-> io::Result<(Process, StdioPipes)> {
1616
use crate::sys::{cvt_r};
1717
const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
18+
let envp = self.capture_env();
1819

1920
if self.saw_nul() {
2021
return Err(io::Error::new(ErrorKind::InvalidInput,
@@ -52,10 +53,13 @@ impl Command {
5253
t!(cvt(libc::chdir(cwd.as_ptr())));
5354
}
5455

56+
let c_envp = envp.as_ref().map(|c| c.as_ptr())
57+
.unwrap_or_else(|| *sys::os::environ() as *const _);
58+
5559
let ret = libc::rtpSpawn(
5660
self.get_argv()[0], // executing program
5761
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,
5963
100 as c_int, // initial priority
6064
thread::min_stack(), // initial stack size.
6165
0, // options

0 commit comments

Comments
 (0)