os/os2: Linux _process_start() write back error on fchdir failure

This commit is contained in:
Roland Kovacs
2025-01-20 23:31:13 +01:00
parent ac30d36206
commit f6ead2e777
+3 -2
View File
@@ -548,8 +548,9 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
write_errno_to_parent_and_abort(child_pipe_fds[WRITE], errno) write_errno_to_parent_and_abort(child_pipe_fds[WRITE], errno)
} }
if dir_fd != linux.AT_FDCWD { if dir_fd != linux.AT_FDCWD {
errno = linux.fchdir(dir_fd) if errno = linux.fchdir(dir_fd); errno != .NONE {
assert(errno == nil) write_errno_to_parent_and_abort(child_pipe_fds[WRITE], errno)
}
} }
errno = linux.execveat(dir_fd, exe_path, &cargs[0], env) errno = linux.execveat(dir_fd, exe_path, &cargs[0], env)