summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-02-07 19:16:31 +0100
committerThomas Haller <thaller@redhat.com>2022-02-09 19:13:04 +0100
commit81f6ba83776a89036983ec226932f5730fa52032 (patch)
treef0242cdd4a31e4e80a46f6c300fedc5cd77ff44f
parentf315ca9e8436c9a16cfaa31d041a762ef506c96a (diff)
downloadNetworkManager-81f6ba83776a89036983ec226932f5730fa52032.tar.gz
platform: return self from nmp_route_manager_ref()
It's just more convenient.
-rw-r--r--src/libnm-platform/nmp-route-manager.c5
-rw-r--r--src/libnm-platform/nmp-route-manager.h4
2 files changed, 5 insertions, 4 deletions
diff --git a/src/libnm-platform/nmp-route-manager.c b/src/libnm-platform/nmp-route-manager.c
index a4cbf2e8bb..6828bb57f9 100644
--- a/src/libnm-platform/nmp-route-manager.c
+++ b/src/libnm-platform/nmp-route-manager.c
@@ -788,12 +788,13 @@ nmp_route_manager_new(NMPlatform *platform)
return self;
}
-void
+NMPRouteManager *
nmp_route_manager_ref(NMPRouteManager *self)
{
- g_return_if_fail(NMP_IS_ROUTE_MANAGER(self));
+ g_return_val_if_fail(NMP_IS_ROUTE_MANAGER(self), NULL);
self->ref_count++;
+ return self;
}
void
diff --git a/src/libnm-platform/nmp-route-manager.h b/src/libnm-platform/nmp-route-manager.h
index 17af8ee0c5..23e4c2d341 100644
--- a/src/libnm-platform/nmp-route-manager.h
+++ b/src/libnm-platform/nmp-route-manager.h
@@ -13,8 +13,8 @@ typedef struct _NMPRouteManager NMPRouteManager;
NMPRouteManager *nmp_route_manager_new(NMPlatform *platform);
-void nmp_route_manager_ref(NMPRouteManager *self);
-void nmp_route_manager_unref(NMPRouteManager *self);
+NMPRouteManager *nmp_route_manager_ref(NMPRouteManager *self);
+void nmp_route_manager_unref(NMPRouteManager *self);
#define nm_auto_unref_route_manager nm_auto(_nmp_route_manager_unref)
NM_AUTO_DEFINE_FCN0(NMPRouteManager *, _nmp_route_manager_unref, nmp_route_manager_unref);