diff mbox series

[v3,1/2] glib-compat: Define g_spawn_check_wait_status()

Message ID 20250115-glib-v3-1-bd3153344698@daynix.com (mailing list archive)
State New
Headers show
Series tap: Use g_spawn_sync() and g_spawn_check_wait_status() | expand

Commit Message

Akihiko Odaki Jan. 15, 2025, 6:25 a.m. UTC
g_spawn_check_exit_status() is renamed to g_spawn_check_wait_status()
in 2.70.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
Tested-by: Lei Yang <leiyang@redhat.com>
---
 include/glib-compat.h | 11 +++++++++++
 1 file changed, 11 insertions(+)
diff mbox series

Patch

diff --git a/include/glib-compat.h b/include/glib-compat.h
index 86be439ba0ef..a553ba13a36e 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -68,6 +68,17 @@ 
  * without generating warnings.
  */
 
+static inline gboolean g_spawn_check_wait_status_qemu(gint wait_status,
+                                                      GError **error)
+{
+#if GLIB_CHECK_VERSION(2, 70, 0)
+    return g_spawn_check_wait_status(wait_status, error);
+#else
+    return g_spawn_check_exit_status(wait_status, error);
+#endif
+}
+#define g_spawn_check_wait_status(w, e) g_spawn_check_wait_status_qemu(w, e)
+
 /*
  * g_memdup2_qemu:
  * @mem: (nullable): the memory to copy.