Browse Source

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

Roland Kovacs 7 months ago
parent
commit
f6ead2e777
1 changed files with 3 additions and 2 deletions
  1. 3 2
      core/os/os2/process_linux.odin

+ 3 - 2
core/os/os2/process_linux.odin

@@ -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)
 		}
 		if dir_fd != linux.AT_FDCWD {
-			errno = linux.fchdir(dir_fd)
-			assert(errno == nil)
+			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)