mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
fix deadlock when in write_errno_to_parent_and_abort state
This commit is contained in:
@@ -523,7 +523,7 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
|||||||
write_errno_to_parent_and_abort :: proc(parent_fd: linux.Fd, errno: linux.Errno) -> ! {
|
write_errno_to_parent_and_abort :: proc(parent_fd: linux.Fd, errno: linux.Errno) -> ! {
|
||||||
error_byte: [1]u8 = { u8(errno) }
|
error_byte: [1]u8 = { u8(errno) }
|
||||||
linux.write(parent_fd, error_byte[:])
|
linux.write(parent_fd, error_byte[:])
|
||||||
intrinsics.trap()
|
linux.exit(126)
|
||||||
}
|
}
|
||||||
|
|
||||||
stdin_fd: linux.Fd
|
stdin_fd: linux.Fd
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
|||||||
#assert(len(posix.Errno) < max(u8))
|
#assert(len(posix.Errno) < max(u8))
|
||||||
errno := u8(posix.errno())
|
errno := u8(posix.errno())
|
||||||
posix.write(parent_fd, &errno, 1)
|
posix.write(parent_fd, &errno, 1)
|
||||||
runtime.trap()
|
posix.exit(126)
|
||||||
}
|
}
|
||||||
|
|
||||||
null := posix.open("/dev/null", {.RDWR})
|
null := posix.open("/dev/null", {.RDWR})
|
||||||
|
|||||||
Reference in New Issue
Block a user