core: return boolean result from nm_dbus_object_clear_and_unexport()

To indicate, whether something was cleared. This will be used later.
This commit is contained in:
Thomas Haller 2021-04-15 19:44:31 +02:00
parent 80f6f4e115
commit d1457410fd
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728
2 changed files with 7 additions and 5 deletions

View file

@ -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;
}
/*****************************************************************************/

View file

@ -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)))