Browse Source

Merge pull request #43056 from Ev1lbl0w/bugfix-wrong-exitcode

Fix wrong exit code being returned
Rémi Verschelde 4 năm trước cách đây
mục cha
commit
d77deda7b6
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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 {