summaryrefslogtreecommitdiff
path: root/src/core/dbus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-01-17 16:07:22 +0100
committerLennart Poettering <lennart@poettering.net>2019-01-17 16:12:38 +0100
commitb1a4981aed3f5e939dbe5a211ca066ac69699b24 (patch)
tree5a10bed0f53a36fae9cda6962ea28543fbc2fd99 /src/core/dbus.c
parentaae82d1a36e01bf7efdaa51ec1c12664fef6db04 (diff)
downloadsystemd-b1a4981aed3f5e939dbe5a211ca066ac69699b24.tar.gz
tree-wide: whenever we allocate a new bus object, close it before dropping final ref
This doesn't really change much, but feels more correct to do, as it ensures that all messages currently queued in the bus connections are definitely unreffed and thus destryoing of the connection object will follow immediately. Strictly speaking this change is entirely unnecessary, since nothing else could have acquired a ref to the connection and queued a message in, however, now that we have the new sd_bus_close_unref() helper it makes a lot of sense to use it here, to ensure that whatever happens nothing that might have been queued fucks with us.
Diffstat (limited to 'src/core/dbus.c')
-rw-r--r--src/core/dbus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus.c b/src/core/dbus.c
index ae595e0567..bab4a1a81b 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -876,7 +876,7 @@ static int bus_setup_api(Manager *m, sd_bus *bus) {
}
int bus_init_api(Manager *m) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
int r;
if (m->api_bus)
@@ -940,7 +940,7 @@ static int bus_setup_system(Manager *m, sd_bus *bus) {
}
int bus_init_system(Manager *m) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
int r;
if (m->system_bus)