@@ -513,17 +513,15 @@ fn program_exists(path: &Path) -> Option<Vec<u16>> {
513
513
impl Stdio {
514
514
fn to_handle ( & self , stdio_id : c:: DWORD , pipe : & mut Option < AnonPipe > ) -> io:: Result < Handle > {
515
515
match * self {
516
- // If no stdio handle is available, then inherit means that it
517
- // should still be unavailable so propagate the
518
- // INVALID_HANDLE_VALUE.
519
516
Stdio :: Inherit => match stdio:: get_handle ( stdio_id) {
520
517
Ok ( io) => unsafe {
521
518
let io = Handle :: from_raw_handle ( io) ;
522
519
let ret = io. duplicate ( 0 , true , c:: DUPLICATE_SAME_ACCESS ) ;
523
520
io. into_raw_handle ( ) ;
524
521
ret
525
522
} ,
526
- Err ( ..) => unsafe { Ok ( Handle :: from_raw_handle ( c:: INVALID_HANDLE_VALUE ) ) } ,
523
+ // If no stdio handle is available, then propagate the null value.
524
+ Err ( ..) => unsafe { Ok ( Handle :: from_raw_handle ( ptr:: null_mut ( ) ) ) } ,
527
525
} ,
528
526
529
527
Stdio :: MakePipe => {
@@ -730,9 +728,9 @@ fn zeroed_startupinfo() -> c::STARTUPINFO {
730
728
wShowWindow : 0 ,
731
729
cbReserved2 : 0 ,
732
730
lpReserved2 : ptr:: null_mut ( ) ,
733
- hStdInput : c :: INVALID_HANDLE_VALUE ,
734
- hStdOutput : c :: INVALID_HANDLE_VALUE ,
735
- hStdError : c :: INVALID_HANDLE_VALUE ,
731
+ hStdInput : ptr :: null_mut ( ) ,
732
+ hStdOutput : ptr :: null_mut ( ) ,
733
+ hStdError : ptr :: null_mut ( ) ,
736
734
}
737
735
}
738
736
0 commit comments