mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-24 11:12:11 +01:00
Add a new process spawning function variant which allows the caller to pass specific file descriptors for stdin, stdout and stderr. It is otherwise identical to g_spawn_async_with_pipes. Allow the same fd to be passed in multiple parameters. To make this workable, the child process logic that closes the fd after the first time it has been dup2'ed needed tweaking; we now just set those fds to be closed upon exec using the CLOEXEC flag. Add a test for this case. This will be used by gnome-shell to avoid performing equivalent dup2 actions in a child_setup function. Dropping use of child_setup will enable use of an upcoming optimized process spawning codepath.