From: Tim Clem <tclem(a)codeweavers.com> Otherwise, if the exec succeeds, the later read() will not actually read anything (EOF since the other end of the pipe is closed), and we'll returned the uninitialized value of `status`. This was preventing NtCreateUserProcess for a Unix process from returning successfully, depending on the state of the stack, even if the fork/exec suceeded. --- dlls/ntdll/unix/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/unix/process.c b/dlls/ntdll/unix/process.c index c6bba1e17a0..5d899338a20 100644 --- a/dlls/ntdll/unix/process.c +++ b/dlls/ntdll/unix/process.c @@ -555,7 +555,7 @@ static NTSTATUS fork_and_exec( OBJECT_ATTRIBUTES *attr, const char *unix_name, i pid_t pid; int fd[2], stdin_fd = -1, stdout_fd = -1; char **argv, **envp; - NTSTATUS status; + NTSTATUS status = STATUS_SUCCESS; #ifdef HAVE_PIPE2 if (pipe2( fd, O_CLOEXEC ) == -1) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8839