mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Merge pull request #4732 from zen3ger/os2-process-incorrect-working-dir
os/os2: Properly update CWD on Linux when using _process_start()
This commit is contained in:
@@ -547,6 +547,11 @@ _process_start :: proc(desc: Process_Desc) -> (process: Process, err: Error) {
|
|||||||
if _, errno = linux.dup2(stderr_fd, STDERR); errno != .NONE {
|
if _, errno = linux.dup2(stderr_fd, STDERR); errno != .NONE {
|
||||||
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 errno = linux.fchdir(dir_fd); errno != .NONE {
|
||||||
|
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)
|
||||||
assert(errno != nil)
|
assert(errno != nil)
|
||||||
|
|||||||
Reference in New Issue
Block a user