From 0f15d5aa40cad6a26b4adb9bd14c1c9de8b0fce5 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 13 Mar 2020 17:31:09 +0100 Subject: [PATCH] shared: allow nm_dbus_connection_call_finish_variant_cb() with D-Bus methods that have no return value --- shared/nm-glib-aux/nm-dbus-aux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shared/nm-glib-aux/nm-dbus-aux.c b/shared/nm-glib-aux/nm-dbus-aux.c index 9cb0a7f09..54e54ca71 100644 --- a/shared/nm-glib-aux/nm-dbus-aux.c +++ b/shared/nm-glib-aux/nm-dbus-aux.c @@ -205,10 +205,9 @@ _call_finish_cb (GObject *source, return; } - if (!return_void) { - nm_assert (!g_variant_is_of_type (ret, G_VARIANT_TYPE ("()"))); + if (!return_void) g_task_return_pointer (task, g_steal_pointer (&ret), (GDestroyNotify) g_variant_unref); - } else { + else { nm_assert (g_variant_is_of_type (ret, G_VARIANT_TYPE ("()"))); g_task_return_boolean (task, TRUE); } @@ -253,7 +252,6 @@ nm_dbus_connection_call_finish_void_strip_dbus_error_cb (GObject *source, * * - user_data must be a GTask, whose reference will be consumed by the * callback. - * - the return GVariant must not be an empty tuple "()". * - the GTask is returned either with error or with a pointer containing the GVariant. */ void