Browse Source

Fix wrong exit code being returned

Ev1lbl0w 4 years ago
parent
commit
0d3a168a53
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/unix/os_unix.cpp

+ 1 - 1
drivers/unix/os_unix.cpp

@@ -331,7 +331,7 @@ Error OS_Unix::execute(const String &p_path, const List<String> &p_arguments, bo
 		int status;
 		waitpid(pid, &status, 0);
 		if (r_exitcode) {
-			*r_exitcode = WEXITSTATUS(status);
+			*r_exitcode = WIFEXITED(status) ? WEXITSTATUS(status) : status;
 		}
 
 	} else {