1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add support for non-blocking IO mode to OS.execute_with_pipe.

This commit is contained in:
bruvzg
2024-07-16 14:38:01 +03:00
parent 05d985496c
commit 10f3c1f587
16 changed files with 67 additions and 26 deletions

View File

@@ -493,7 +493,7 @@ Dictionary OS_Unix::get_memory_info() const {
return meminfo;
}
Dictionary OS_Unix::execute_with_pipe(const String &p_path, const List<String> &p_arguments) {
Dictionary OS_Unix::execute_with_pipe(const String &p_path, const List<String> &p_arguments, bool p_blocking) {
#define CLEAN_PIPES \
if (pipe_in[0] >= 0) { \
::close(pipe_in[0]); \
@@ -578,11 +578,11 @@ Dictionary OS_Unix::execute_with_pipe(const String &p_path, const List<String> &
Ref<FileAccessUnixPipe> main_pipe;
main_pipe.instantiate();
main_pipe->open_existing(pipe_out[0], pipe_in[1]);
main_pipe->open_existing(pipe_out[0], pipe_in[1], p_blocking);
Ref<FileAccessUnixPipe> err_pipe;
err_pipe.instantiate();
err_pipe->open_existing(pipe_err[0], 0);
err_pipe->open_existing(pipe_err[0], 0, p_blocking);
ProcessInfo pi;
process_map_mutex.lock();