mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
stop trying to handle child pipe read errors in process_start
This commit is contained in:
@@ -495,16 +495,10 @@ _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.
|
|
||||||
}
|
|
||||||
|
|
||||||
|
// 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])
|
child_errno := linux.Errno(child_byte[0])
|
||||||
if child_errno != .NONE {
|
if child_errno != .NONE {
|
||||||
// We can assume it trapped here.
|
// We can assume it trapped here.
|
||||||
@@ -512,6 +506,7 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
|||||||
process.pid = 0
|
process.pid = 0
|
||||||
return process, _get_platform_error(child_errno)
|
return process, _get_platform_error(child_errno)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
process, _ = process_open(int(pid))
|
process, _ = process_open(int(pid))
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user