Apply suggestions from code review

This commit is contained in:
Christiaan Dirkx 2021-04-21 16:06:32 +02:00
parent 9bd9cbb28e
commit aa46f08abd
2 changed files with 4 additions and 2 deletions

View File

@ -223,7 +223,7 @@ pub fn get_gid(&self) -> Option<gid_t> {
pub fn get_groups(&self) -> Option<&[gid_t]> {
self.groups.as_deref()
}
#[allow(dead_code)]
pub fn get_closures(&mut self) -> &mut Vec<Box<dyn FnMut() -> io::Result<()> + Send + Sync>> {
&mut self.closures
}

View File

@ -18,7 +18,6 @@ pub fn spawn(
needs_stdin: bool,
) -> io::Result<(Process, StdioPipes)> {
use crate::sys::cvt_r;
// const CLOEXEC_MSG_FOOTER: &'static [u8] = b"NOEX";
let envp = self.capture_env();
if self.saw_nul() {
@ -61,6 +60,9 @@ macro_rules! t {
t!(cvt(libc::chdir(cwd.as_ptr())));
}
// pre_exec closures are ignored on VxWorks
let _ = self.get_closures();
let c_envp = envp
.as_ref()
.map(|c| c.as_ptr())