diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2019-09-26 09:44:46 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-09-26 09:44:46 +0200 |
| commit | 8a89434acf2fcd55cee77eb3e8f9b8901dbdfa38 (patch) | |
| tree | f86bc39ba231e880751b10f99fec7b1a011a4d8f /core | |
| parent | c2a550565dc5c8b6e420c41150787c202e93a39b (diff) | |
| parent | b4c927b514bcc550fb6f8f186219bb181aeeae33 (diff) | |
Merge pull request #32033 from NNesh/fix/blocking-execude-code
Added returning an exit code by the blocking OS::execute method
Diffstat (limited to 'core')
| -rw-r--r-- | core/bind/core_bind.cpp | 5 |
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; } |