Pass on null handle values to child process
This commit is contained in:
parent
7aa3613908
commit
c43210f67b
@ -513,9 +513,6 @@ fn program_exists(path: &Path) -> Option<Vec<u16>> {
|
||||
impl Stdio {
|
||||
fn to_handle(&self, stdio_id: c::DWORD, pipe: &mut Option<AnonPipe>) -> io::Result<Handle> {
|
||||
match *self {
|
||||
// If no stdio handle is available, then inherit means that it
|
||||
// should still be unavailable so propagate the
|
||||
// INVALID_HANDLE_VALUE.
|
||||
Stdio::Inherit => match stdio::get_handle(stdio_id) {
|
||||
Ok(io) => unsafe {
|
||||
let io = Handle::from_raw_handle(io);
|
||||
@ -523,7 +520,8 @@ impl Stdio {
|
||||
io.into_raw_handle();
|
||||
ret
|
||||
},
|
||||
Err(..) => unsafe { Ok(Handle::from_raw_handle(c::INVALID_HANDLE_VALUE)) },
|
||||
// If no stdio handle is available, then propagate the null value.
|
||||
Err(..) => unsafe { Ok(Handle::from_raw_handle(ptr::null_mut())) },
|
||||
},
|
||||
|
||||
Stdio::MakePipe => {
|
||||
@ -730,9 +728,9 @@ fn zeroed_startupinfo() -> c::STARTUPINFO {
|
||||
wShowWindow: 0,
|
||||
cbReserved2: 0,
|
||||
lpReserved2: ptr::null_mut(),
|
||||
hStdInput: c::INVALID_HANDLE_VALUE,
|
||||
hStdOutput: c::INVALID_HANDLE_VALUE,
|
||||
hStdError: c::INVALID_HANDLE_VALUE,
|
||||
hStdInput: ptr::null_mut(),
|
||||
hStdOutput: ptr::null_mut(),
|
||||
hStdError: ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user