diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index a060ed8af22..7ec5a2e2aa5 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -357,7 +357,7 @@ Error OS_Unix::execute(const String &p_path, const List &p_arguments, bo int status; waitpid(pid, &status, 0); if (r_exitcode) - *r_exitcode = WEXITSTATUS(status); + *r_exitcode = WIFEXITED(status) ? WEXITSTATUS(status) : status; } else {