mirror of
https://github.com/systemd/systemd
synced 2024-10-15 12:34:37 +00:00
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
This commit is contained in:
parent
bd62b74486
commit
92e31da100
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue