summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRuslan Mullayanov <mullruslan@yandex.ru>2019-09-07 22:39:24 +0500
committerRĂ©mi Verschelde <rverschelde@gmail.com>2019-09-26 08:12:07 +0200
commitb4c927b514bcc550fb6f8f186219bb181aeeae33 (patch)
tree1c49466702d98f1444e95ce9011e01225d54d885 /core
parent084481b79da1515e2acd9be68e13aec67e35e80b (diff)
Added an exit code to the blocking mode of OS::execute
Updated documentation accordingly. Fixes #31881.
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 30aaa0e646..d07ba44788 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -481,15 +481,18 @@ Error _OS::shell_open(String p_uri) {
int _OS::execute(const String &p_path, const Vector<String> &p_arguments, bool p_blocking, Array p_output, bool p_read_stderr) {
OS::ProcessID pid = -2;
+ int exitcode = 0;
List<String> args;
for (int i = 0; i < p_arguments.size(); i++)
args.push_back(p_arguments[i]);
String pipe;
- Error err = OS::get_singleton()->execute(p_path, args, p_blocking, &pid, &pipe, NULL, p_read_stderr);
+ Error err = OS::get_singleton()->execute(p_path, args, p_blocking, &pid, &pipe, &exitcode, p_read_stderr);
p_output.clear();
p_output.push_back(pipe);
if (err != OK)
return -1;
+ else if (p_blocking)
+ return exitcode;
else
return pid;
}