summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2019-05-04 11:45:13 +0200
committerThomas Haller <thaller@redhat.com>2019-05-12 09:56:36 +0200
commitf7fff62067ab0d51c810aa99706b73334c5af644 (patch)
treecb32a9269d22275042d059c55a216fe7dba25a60
parentb9e2fcccf710237e44437fa37e278eb47a173484 (diff)
downloadNetworkManager-f7fff62067ab0d51c810aa99706b73334c5af644.tar.gz
shared: add nm_clear_g_dbus_connection_signal() helper
-rw-r--r--shared/nm-glib-aux/nm-dbus-aux.h17
1 files changed, 17 insertions, 0 deletions
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,