mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
stop trying to handle child pipe read errors in process_start
This commit is contained in:
@@ -495,22 +495,17 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
|||||||
for errno == .EINTR {
|
for errno == .EINTR {
|
||||||
n, errno = linux.read(child_pipe_fds[READ], child_byte[:])
|
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 the read failed, something weird happened. Do not return the read
|
||||||
if child_errno != .NONE {
|
// error so the user knows to wait on it.
|
||||||
// We can assume it trapped here.
|
if errno == .NONE {
|
||||||
_reap_terminated(process)
|
child_errno := linux.Errno(child_byte[0])
|
||||||
process.pid = 0
|
if child_errno != .NONE {
|
||||||
return process, _get_platform_error(child_errno)
|
// We can assume it trapped here.
|
||||||
|
_reap_terminated(process)
|
||||||
|
process.pid = 0
|
||||||
|
return process, _get_platform_error(child_errno)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
process, _ = process_open(int(pid))
|
process, _ = process_open(int(pid))
|
||||||
|
|||||||
Reference in New Issue
Block a user