summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-04-15 19:44:31 +0200
committerThomas Haller <thaller@redhat.com>2021-04-20 17:25:21 +0200
commitd1457410fd21e680472a9eab303cb1e0d27d4f84 (patch)
treed1d99e7e89d9fefebf62d13aaeb28dd27b187f7b
parent80f6f4e115a513029720049065d2d4e24115ef75 (diff)
downloadNetworkManager-d1457410fd21e680472a9eab303cb1e0d27d4f84.tar.gz
core: return boolean result from nm_dbus_object_clear_and_unexport()
To indicate, whether something was cleared. This will be used later.
-rw-r--r--src/core/nm-dbus-object.c10
-rw-r--r--src/core/nm-dbus-object.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/core/nm-dbus-object.c b/src/core/nm-dbus-object.c
index 6f294fe2ec..0414973929 100644
--- a/src/core/nm-dbus-object.c
+++ b/src/core/nm-dbus-object.c
@@ -183,23 +183,25 @@ nm_dbus_object_unexport_on_idle(gpointer /* (NMDBusObject *) */ self_take)
/*****************************************************************************/
-void
+gboolean
_nm_dbus_object_clear_and_unexport(NMDBusObject **location)
{
NMDBusObject *self;
- g_return_if_fail(location);
+ g_return_val_if_fail(location, FALSE);
+
if (!*location)
- return;
+ return FALSE;
self = g_steal_pointer(location);
- g_return_if_fail(NM_IS_DBUS_OBJECT(self));
+ g_return_val_if_fail(NM_IS_DBUS_OBJECT(self), FALSE);
if (self->internal.path)
nm_dbus_object_unexport(self);
g_object_unref(self);
+ return TRUE;
}
/*****************************************************************************/
diff --git a/src/core/nm-dbus-object.h b/src/core/nm-dbus-object.h
index 94eb2d0d76..c7c1b4f445 100644
--- a/src/core/nm-dbus-object.h
+++ b/src/core/nm-dbus-object.h
@@ -166,7 +166,7 @@ void nm_dbus_object_unexport(gpointer /* (NMDBusObject *) */ self);
void nm_dbus_object_unexport_on_idle(gpointer /* (NMDBusObject *) */ self_take);
-void _nm_dbus_object_clear_and_unexport(NMDBusObject **location);
+gboolean _nm_dbus_object_clear_and_unexport(NMDBusObject **location);
#define nm_dbus_object_clear_and_unexport(location) \
_nm_dbus_object_clear_and_unexport(NM_CAST_PPTR(NMDBusObject, (location)))