From 0d3a168a532349d0759a033b04efe04e5ef72c32 Mon Sep 17 00:00:00 2001 From: Ev1lbl0w Date: Sat, 24 Oct 2020 19:16:49 +0100 Subject: Fix wrong exit code being returned --- drivers/unix/os_unix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp index 96c338f86b..eec6eb8303 100644 --- a/drivers/unix/os_unix.cpp +++ b/drivers/unix/os_unix.cpp @@ -331,7 +331,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 { -- cgit v1.2.3