From a52f7c129f8091a4df0d1e6effe068813bc347f4 Mon Sep 17 00:00:00 2001 From: jason Date: Sat, 10 Aug 2024 09:13:07 -0400 Subject: [PATCH] stop trying to handle child pipe read errors in process_start --- core/os/os2/process_linux.odin | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/core/os/os2/process_linux.odin b/core/os/os2/process_linux.odin index e64678f74..72acf71ff 100644 --- a/core/os/os2/process_linux.odin +++ b/core/os/os2/process_linux.odin @@ -495,22 +495,17 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) { for errno == .EINTR { n, errno = linux.read(child_pipe_fds[READ], child_byte[:]) } - if errno != .NONE { - child_state, _ := process_wait(process, 0) - if child_state.exited { - process.pid = 0 // If the child exited, we reaped it. - return process, _get_platform_error(errno) - } - // else.. something weird happened, but there IS a running process. - // Do not return the read error so the user knows to wait on it. - } - child_errno := linux.Errno(child_byte[0]) - if child_errno != .NONE { - // We can assume it trapped here. - _reap_terminated(process) - process.pid = 0 - return process, _get_platform_error(child_errno) + // If the read failed, something weird happened. Do not return the read + // error so the user knows to wait on it. + if errno == .NONE { + child_errno := linux.Errno(child_byte[0]) + if child_errno != .NONE { + // We can assume it trapped here. + _reap_terminated(process) + process.pid = 0 + return process, _get_platform_error(child_errno) + } } process, _ = process_open(int(pid))