shell/app: Remove some dead code

`g_desktop_app_info_launch_uris_as_manager_with_fds()` was added
in GIO 2.57.2. We now depend on at least 2.79.2, so we no longer
need a fallback path for the case the function isn't available.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3361>
This commit is contained in:
Florian Müllner
2024-06-06 15:31:34 +02:00
committed by Marge Bot
parent f0c14bdef3
commit 55027bb084
3 changed files with 0 additions and 48 deletions

View File

@@ -31,9 +31,6 @@
/* Define if _NL_TIME_FIRST_WEEKDATE is available */
#mesondefine HAVE__NL_TIME_FIRST_WEEKDAY
/* Define if you have the `g_desktop_app_info_launch_uris_as_manager_with_fds` function */
#mesondefine HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
/* Define if fdwalk is available in libc */
#mesondefine HAVE_FDWALK

View File

@@ -146,11 +146,6 @@ cdata.set('HAVE_NETWORKMANAGER', have_networkmanager)
cdata.set('HAVE_PIPEWIRE', have_pipewire)
cdata.set('HAVE_SYSTEMD', have_systemd)
# New API added in glib-2.57.2
cdata.set('HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS',
cc.has_function('g_desktop_app_info_launch_uris_as_manager_with_fds',
dependencies : gio_dep)
)
cdata.set('HAVE_FDWALK', cc.has_function('fdwalk'))
cdata.set('HAVE_MALLINFO', cc.has_function('mallinfo'))
cdata.set('HAVE_MALLINFO2', cc.has_function('mallinfo2'))

View File

@@ -1241,33 +1241,6 @@ child_context_setup (gpointer user_data)
meta_context_restore_rlimit_nofile (meta_context, NULL);
}
#if !defined(HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS) && defined(HAVE_SYSTEMD)
/* This sets up the launched application to log to the journal
* using its own identifier, instead of just "gnome-session".
*/
static void
app_child_setup (gpointer user_data)
{
const char *appid = user_data;
int res;
int journalfd = sd_journal_stream_fd (appid, LOG_INFO, FALSE);
ShellGlobal *shell_global = shell_global_get ();
if (journalfd >= 0)
{
do
res = dup2 (journalfd, 1);
while (G_UNLIKELY (res == -1 && errno == EINTR));
do
res = dup2 (journalfd, 2);
while (G_UNLIKELY (res == -1 && errno == EINTR));
(void) close (journalfd);
}
child_context_setup (shell_global);
}
#endif
static void
wait_pid (GDesktopAppInfo *appinfo,
GPid pid,
@@ -1381,7 +1354,6 @@ shell_app_launch (ShellApp *app,
flags = G_SPAWN_SEARCH_PATH | G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_LEAVE_DESCRIPTORS_OPEN;
#ifdef HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS
/* Optimized spawn path, avoiding a child_setup function */
{
int journalfd = -1;
@@ -1403,18 +1375,6 @@ shell_app_launch (ShellApp *app,
if (journalfd >= 0)
(void) close (journalfd);
}
#else /* !HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
ret = g_desktop_app_info_launch_uris_as_manager (app->info, NULL,
context,
flags,
#ifdef HAVE_SYSTEMD
app_child_setup, (gpointer)shell_app_get_id (app),
#else
child_context_setup, shell_global,
#endif
wait_pid, NULL,
error);
#endif /* HAVE_GIO_DESKTOP_LAUNCH_URIS_WITH_FDS */
g_object_unref (context);
return ret;