diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-01-17 16:07:22 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-01-17 16:12:38 +0100 |
commit | b1a4981aed3f5e939dbe5a211ca066ac69699b24 (patch) | |
tree | 5a10bed0f53a36fae9cda6962ea28543fbc2fd99 /src/busctl/busctl.c | |
parent | initctl: shorten and update code a bit (diff) | |
download | systemd-b1a4981aed3f5e939dbe5a211ca066ac69699b24.tar.xz 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/busctl/busctl.c')
-rw-r--r-- | src/busctl/busctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/busctl/busctl.c b/src/busctl/busctl.c index 96b4177495..08d9e70c96 100644 --- a/src/busctl/busctl.c +++ b/src/busctl/busctl.c @@ -67,7 +67,7 @@ static int json_transform_message(sd_bus_message *m, JsonVariant **ret); static void json_dump_with_flags(JsonVariant *v, FILE *f); static int acquire_bus(bool set_monitor, sd_bus **ret) { - _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; + _cleanup_(sd_bus_close_unrefp) sd_bus *bus = NULL; int r; r = sd_bus_new(&bus); |