utils: clear GUnixFDList before entering main loop

If we do not clear the FDList before entering the main loop, the splice
async command may not complete because the pipe fd is still held. This
fixes an issue where builder_maybe_host_spawnv() hangs indefinitely when
run inside a Flatpak application.

Closes: #100
Approved by: alexlarsson
tingping/wmclass
Christian Hergert 2018-01-11 20:32:38 -08:00 committed by Atomic Bot
parent 63e0722cb0
commit 1929fd1cc6
1 changed files with 5 additions and 0 deletions

View File

@ -1575,6 +1575,11 @@ builder_host_spawnv (GFile *dir,
g_variant_get (ret, "(u)", &client_pid);
data.client_pid = client_pid;
/* Drop the FDList immediately or splice_async() may not
* complete when the peer process exists, causing us to hang.
*/
g_clear_object (&fd_list);
g_main_loop_run (loop);
g_source_remove (sigterm_id);