[gnome-desktop/ebassi/update-for-gtk4: 7/22] Avoid using deprecated GLib API
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-desktop/ebassi/update-for-gtk4: 7/22] Avoid using deprecated GLib API
- Date: Fri, 19 Nov 2021 13:16:48 +0000 (UTC)
commit fc410c07de6417b9e576177abd2f5ccebe6429aa
Author: Emmanuele Bassi <ebassi gnome org>
Date: Tue Oct 26 18:00:05 2021 +0100
Avoid using deprecated GLib API
When building against GLib ≥ 2.70, use g_spawn_check_wait_status(); when
building against older versions of GLib, use a compatibility shim.
libgnome-desktop/gnome-desktop-thumbnail-script.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/libgnome-desktop/gnome-desktop-thumbnail-script.c
b/libgnome-desktop/gnome-desktop-thumbnail-script.c
index ddcc1511..841ca17d 100644
--- a/libgnome-desktop/gnome-desktop-thumbnail-script.c
+++ b/libgnome-desktop/gnome-desktop-thumbnail-script.c
@@ -1080,6 +1080,11 @@ print_script_debug (GStrv expanded_script)
g_string_free (out, TRUE);
}
+/* Compatibility shim for older versions of GLib */
+#if !GLIB_CHECK_VERSION (2, 70, 0)
+#define g_spawn_check_wait_status(status,error) g_spawn_check_exit_status (status, error)
+#endif
+
GBytes *
gnome_desktop_thumbnail_script_exec (const char *cmd,
int size,
@@ -1107,7 +1112,7 @@ gnome_desktop_thumbnail_script_exec (const char *cmd,
ret = g_spawn_sync (NULL, expanded_script, NULL, G_SPAWN_SEARCH_PATH,
child_setup, exec->fd_array, NULL, &error_out,
&exit_status, error);
- if (ret && g_spawn_check_exit_status (exit_status, error))
+ if (ret && g_spawn_check_wait_status (exit_status, error))
{
char *contents;
gsize length;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]