gdesktopappinfo: enable fast posix_spawn gspawn codepath

In order to use the new posix_spawn gspawn codepath, for more robust
app launching when available memory is low, we need to meet some
conditions.

child_setup needs to be NULL for this optimization to work, so drop
the internal child_setup that is used here. Replace it with a lightweight
wrapper binary (gio-launch-desktop) that sets GIO_LAUNCHED_DESKTOP_FILE_PID
before executing the app.

Adjust PATH for gio tests so that it can execute the new binary from the
build directory.
This commit is contained in:
Daniel Drake
2018-06-04 19:07:11 -06:00
parent 61f54591ac
commit 742efe6232
6 changed files with 106 additions and 66 deletions

View File

@@ -411,6 +411,12 @@ if host_system != 'windows'
contenttype_sources += files('gcontenttype.c')
appinfo_sources += files('gdesktopappinfo.c')
gio_unix_include_headers += files('gdesktopappinfo.h')
executable('gio-launch-desktop', 'gio-launch-desktop.c',
install : true,
c_args : gio_c_args,
# intl.lib is not compatible with SAFESEH
link_args : noseh_link_args)
endif
subdir('xdgmime')