diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-01-17 15:53:15 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-01-17 16:12:38 +0100 |
commit | 92e31da10065b6eadb06f6f92e386b97a0058f28 (patch) | |
tree | a5f9d5c5421639980da9ea69504f9765d255a7ec | |
parent | sd-bus: add sd_bus_close_unref() helper (diff) | |
download | systemd-92e31da10065b6eadb06f6f92e386b97a0058f28.tar.xz systemd-92e31da10065b6eadb06f6f92e386b97a0058f28.zip |
tree-wide: make sure to flush/close all bus connections when our daemons exit
Let's make sure everything is written out ebfore we exit, so that no
messages keep our bus connections referenced.
Fixes: #11462
-rw-r--r-- | src/login/logind.c | 2 | ||||
-rw-r--r-- | src/login/user-runtime-dir.c | 2 | ||||
-rw-r--r-- | src/machine/machined.c | 2 | ||||
-rw-r--r-- | src/network/networkd-manager.c | 2 | ||||
-rw-r--r-- | src/portable/portabled.c | 2 | ||||
-rw-r--r-- | src/resolve/resolved-manager.c | 2 | ||||
-rw-r--r-- | src/stdio-bridge/stdio-bridge.c | 2 | ||||
-rw-r--r-- | src/timesync/timesyncd-manager.c | 2 |
8 files changed, 8 insertions, 8 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index 8d85de9b43..95ec0a57c6 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -146,7 +146,7 @@ static Manager* manager_unref(Manager *m) { bus_verify_polkit_async_registry_free(m->polkit_registry); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); sd_event_unref(m->event); safe_close(m->reserve_vt_fd); diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c index 5e58e4baad..eb66e18de1 100644 --- a/src/login/user-runtime-dir.c +++ b/src/login/user-runtime-dir.c @@ -22,7 +22,7 @@ static int acquire_runtime_dir_size(uint64_t *ret) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; - _cleanup_(sd_bus_unrefp) sd_bus *bus = NULL; + _cleanup_(sd_bus_flush_close_unrefp) sd_bus *bus = NULL; int r; r = sd_bus_default_system(&bus); diff --git a/src/machine/machined.c b/src/machine/machined.c index 9f23e369a4..0b92b1c6ee 100644 --- a/src/machine/machined.c +++ b/src/machine/machined.c @@ -81,7 +81,7 @@ static Manager* manager_unref(Manager *m) { bus_verify_polkit_async_registry_free(m->polkit_registry); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); sd_event_unref(m->event); return mfree(m); diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c index 81c81f18af..c8d369e2a0 100644 --- a/src/network/networkd-manager.c +++ b/src/network/networkd-manager.c @@ -1456,7 +1456,7 @@ void manager_free(Manager *m) { sd_device_monitor_unref(m->device_monitor); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); free(m->dynamic_timezone); free(m->dynamic_hostname); diff --git a/src/portable/portabled.c b/src/portable/portabled.c index 63fc340469..49a359fd31 100644 --- a/src/portable/portabled.c +++ b/src/portable/portabled.c @@ -53,7 +53,7 @@ static Manager* manager_unref(Manager *m) { bus_verify_polkit_async_registry_free(m->polkit_registry); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); sd_event_unref(m->event); return mfree(m); diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index b7dc09ae37..b3d35c8341 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -689,7 +689,7 @@ Manager *manager_free(Manager *m) { manager_mdns_stop(m); manager_dns_stub_stop(m); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); sd_event_source_unref(m->sigusr1_event_source); sd_event_source_unref(m->sigusr2_event_source); diff --git a/src/stdio-bridge/stdio-bridge.c b/src/stdio-bridge/stdio-bridge.c index 3a21aa4aed..7060897ab7 100644 --- a/src/stdio-bridge/stdio-bridge.c +++ b/src/stdio-bridge/stdio-bridge.c @@ -91,7 +91,7 @@ static int parse_argv(int argc, char *argv[]) { } static int run(int argc, char *argv[]) { - _cleanup_(sd_bus_unrefp) sd_bus *a = NULL, *b = NULL; + _cleanup_(sd_bus_flush_close_unrefp) sd_bus *a = NULL, *b = NULL; sd_id128_t server_id; bool is_unix; int r, in_fd, out_fd; diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c index 4b0696f3a3..b3bd7235c9 100644 --- a/src/timesync/timesyncd-manager.c +++ b/src/timesync/timesyncd-manager.c @@ -937,7 +937,7 @@ void manager_free(Manager *m) { sd_resolve_unref(m->resolve); sd_event_unref(m->event); - sd_bus_unref(m->bus); + sd_bus_flush_close_unref(m->bus); free(m); } |