summaryrefslogtreecommitdiff
path: root/src/shared/bus-util.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/shared/bus-util.c
parentaae82d1a36e01bf7efdaa51ec1c12664fef6db04 (diff)
downloadsystemd-b1a4981aed3f5e939dbe5a211ca066ac69699b24.tar.gz
systemd-b1a4981aed3f5e939dbe5a211ca066ac69699b24.tar.bz2
systemd-b1a4981aed3f5e939dbe5a211ca066ac69699b24.zip
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/shared/bus-util.c')
-rw-r--r--src/shared/bus-util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 976643e4ce..cbcf698e96 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -559,7 +559,7 @@ int bus_check_peercred(sd_bus *c) {
}
int bus_connect_system_systemd(sd_bus **_bus) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
int r;
assert(_bus);
@@ -592,7 +592,7 @@ int bus_connect_system_systemd(sd_bus **_bus) {
}
int bus_connect_user_systemd(sd_bus **_bus) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
_cleanup_free_ char *ee = NULL;
const char *e;
int r;
@@ -1279,7 +1279,7 @@ int bus_map_all_properties(
}
int bus_connect_transport(BusTransport transport, const char *host, bool user, sd_bus **ret) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
int r;
assert(transport >= 0);
@@ -1666,7 +1666,7 @@ int bus_track_add_name_many(sd_bus_track *t, char **l) {
}
int bus_open_system_watch_bind_with_description(sd_bus **ret, const char *description) {
- _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
+ _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL;
const char *e;
int r;