From f7fff62067ab0d51c810aa99706b73334c5af644 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Sat, 4 May 2019 11:45:13 +0200 Subject: [PATCH] shared: add nm_clear_g_dbus_connection_signal() helper --- shared/nm-glib-aux/nm-dbus-aux.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/shared/nm-glib-aux/nm-dbus-aux.h b/shared/nm-glib-aux/nm-dbus-aux.h index c888351b69..5f112002b2 100644 --- a/shared/nm-glib-aux/nm-dbus-aux.h +++ b/shared/nm-glib-aux/nm-dbus-aux.h @@ -25,6 +25,23 @@ /*****************************************************************************/ +static inline gboolean +nm_clear_g_dbus_connection_signal (GDBusConnection *dbus_connection, + guint *id) +{ + guint v; + + if ( id + && (v = *id)) { + *id = 0; + g_dbus_connection_signal_unsubscribe (dbus_connection, v); + return TRUE; + } + return FALSE; +} + +/*****************************************************************************/ + static inline guint nm_dbus_connection_signal_subscribe_name_owner_changed (GDBusConnection *dbus_connection, const char *service_name,