authorgravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2022-02-06 06:05:40-07:00
committergravatar for johnnymarler@gmail.comJonathan Marler <johnnymarler@gmail.com> 2022-02-06 18:05:21-07:00
log8f830207c47987de9767130d54abff79c8ec257d
tree953d7ac19084986c3a021c7fcff80f7366633a64
parent53d8a25dab5ddcea16ac70cdcdf28cb3e4944cbb

fix bug I think I found while manually reviewing


1 files changed, 2 insertions(+), 8 deletions(-)

lib/std/child_process.zig+2-8
...@@ -288,10 +288,8 @@ pub const ChildProcess = struct {...@@ -288,10 +288,8 @@ pub const ChildProcess = struct {
288 else => |err| return windows.unexpectedError(err),288 else => |err| return windows.unexpectedError(err),
289 }289 }
290 }290 }
291 if (wait_object_count == 0)
292 return;
293291
294 while (true) {292 while (wait_object_count > 0) {
295 const status = windows.kernel32.WaitForMultipleObjects(wait_object_count, &wait_objects, 0, windows.INFINITE);293 const status = windows.kernel32.WaitForMultipleObjects(wait_object_count, &wait_objects, 0, windows.INFINITE);
296 if (status == windows.WAIT_FAILED) {294 if (status == windows.WAIT_FAILED) {
297 switch (windows.kernel32.GetLastError()) {295 switch (windows.kernel32.GetLastError()) {
...@@ -315,11 +313,7 @@ pub const ChildProcess = struct {...@@ -315,11 +313,7 @@ pub const ChildProcess = struct {
315 var read_bytes: u32 = undefined;313 var read_bytes: u32 = undefined;
316 if (windows.kernel32.GetOverlappedResult(handles[i], &overlapped[i], &read_bytes, 0) == 0) {314 if (windows.kernel32.GetOverlappedResult(handles[i], &overlapped[i], &read_bytes, 0) == 0) {
317 switch (windows.kernel32.GetLastError()) {315 switch (windows.kernel32.GetLastError()) {
318 .BROKEN_PIPE => {316 .BROKEN_PIPE => continue,
319 if (wait_object_count == 0)
320 break;
321 continue;
322 },
323 else => |err| return windows.unexpectedError(err),317 else => |err| return windows.unexpectedError(err),
324 }318 }
325 }319 }