diff --git a/src/compat/compat.c b/src/compat/compat.c index 572ed451f..9c0d1feb4 100644 --- a/src/compat/compat.c +++ b/src/compat/compat.c @@ -28,7 +28,9 @@ int set_fd_nonblocking(int fd, unsigned state, unsigned* oldstate){ // FIXME pid_t waitpid(pid_t pid, int* state, int options){ (void)options; // FIXME honor WNOHANG WaitForSingleObject(pid, INFINITE); - GetExitCodeProcess(pid, state); + long unsigned pstate; + GetExitCodeProcess(pid, &pstate); + *state = pstate; CloseHandle(pid); return pid; }