@@ -219,8 +219,8 @@ pub const ChildProcess = struct {
219
219
}
220
220
});
221
221
222
- os .windowsClose (self .handle );
223
- os .windowsClose (self .thread_handle );
222
+ os .close (self .handle );
223
+ os .close (self .thread_handle );
224
224
self .cleanupStreams ();
225
225
return result ;
226
226
}
@@ -417,7 +417,7 @@ pub const ChildProcess = struct {
417
417
} else {
418
418
undefined
419
419
};
420
- defer { if (any_ignore ) os .windowsClose (nul_handle ); };
420
+ defer { if (any_ignore ) os .close (nul_handle ); };
421
421
if (any_ignore ) {
422
422
% return windowsSetHandleInfo (nul_handle , windows .HANDLE_FLAG_INHERIT , 0 );
423
423
}
@@ -556,18 +556,18 @@ pub const ChildProcess = struct {
556
556
}
557
557
};
558
558
559
- if (self . stdin_behavior == StdIo . Pipe ) {
560
- self .stdin = io .File .openHandle (g_hChildStd_IN_Wr );
559
+ if (g_hChildStd_IN_Wr ) | h | {
560
+ self .stdin = io .File .openHandle (h );
561
561
} else {
562
562
self .stdin = null ;
563
563
}
564
- if (self . stdout_behavior == StdIo . Pipe ) {
565
- self .stdout = io .File .openHandle (g_hChildStd_OUT_Rd );
564
+ if (g_hChildStd_OUT_Rd ) | h | {
565
+ self .stdout = io .File .openHandle (h );
566
566
} else {
567
567
self .stdout = null ;
568
568
}
569
- if (self . stderr_behavior == StdIo . Pipe ) {
570
- self .stderr = io .File .openHandle (g_hChildStd_ERR_Rd );
569
+ if (g_hChildStd_ERR_Rd ) | h | {
570
+ self .stderr = io .File .openHandle (h );
571
571
} else {
572
572
self .stderr = null ;
573
573
}
@@ -576,9 +576,9 @@ pub const ChildProcess = struct {
576
576
self .thread_handle = piProcInfo .hThread ;
577
577
self .term = null ;
578
578
579
- if (self .stdin_behavior == StdIo .Pipe ) { os .windowsClose (?? g_hChildStd_IN_Rd ); }
580
- if (self .stderr_behavior == StdIo .Pipe ) { os .windowsClose (?? g_hChildStd_ERR_Wr ); }
581
- if (self .stdout_behavior == StdIo .Pipe ) { os .windowsClose (?? g_hChildStd_OUT_Wr ); }
579
+ if (self .stdin_behavior == StdIo .Pipe ) { os .close (?? g_hChildStd_IN_Rd ); }
580
+ if (self .stderr_behavior == StdIo .Pipe ) { os .close (?? g_hChildStd_ERR_Wr ); }
581
+ if (self .stdout_behavior == StdIo .Pipe ) { os .close (?? g_hChildStd_OUT_Wr ); }
582
582
}
583
583
584
584
fn setUpChildIo (stdio : StdIo , pipe_fd : i32 , std_fileno : i32 , dev_null_fd : i32 ) - > % void {
@@ -647,8 +647,8 @@ fn windowsCreateCommandLine(allocator: &Allocator, argv: []const []const u8) ->
647
647
}
648
648
649
649
fn windowsDestroyPipe (rd : ? windows.HANDLE , wr : ? windows.HANDLE ) {
650
- if (rd ) | h | os .windowsClose (h );
651
- if (wr ) | h | os .windowsClose (h );
650
+ if (rd ) | h | os .close (h );
651
+ if (wr ) | h | os .close (h );
652
652
}
653
653
654
654
0 commit comments