diff options
author | Daniel Mack <daniel@zonque.org> | 2015-08-05 15:58:39 +0200 |
---|---|---|
committer | Daniel Mack <daniel@zonque.org> | 2015-08-05 17:06:45 +0200 |
commit | 3cde9e8fa0ae2a424ae2e6e27e14668ca5d90c98 (patch) | |
tree | d8320bbaeec3fae3b838278f4c764f185eabe7c9 /src/login/logind.c | |
parent | 652f0e397fab33e325f4119dceece9f334f549cf (diff) |
logind: switch to sd_bus_track helper
Let logind use the sd_bus_track helper object to track the controllers of
sessions. This does not only remove quite some code but also kills the
unconditional matches for all NameOwnerChanged signals.
The latter is something we should never ever do, as it wakes up the daemon
every time a client connects, which doesn't scale.
Diffstat (limited to 'src/login/logind.c')
-rw-r--r-- | src/login/logind.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index e2fb496289..49a2811842 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -76,10 +76,7 @@ static Manager *manager_new(void) { m->user_units = hashmap_new(&string_hash_ops); m->session_units = hashmap_new(&string_hash_ops); - m->busnames = set_new(&string_hash_ops); - - if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->busnames || - !m->user_units || !m->session_units) + if (!m->devices || !m->seats || !m->sessions || !m->users || !m->inhibitors || !m->buttons || !m->user_units || !m->session_units) goto fail; m->kill_exclude_users = strv_new("root", NULL); @@ -141,8 +138,6 @@ static void manager_free(Manager *m) { hashmap_free(m->user_units); hashmap_free(m->session_units); - set_free_free(m->busnames); - sd_event_source_unref(m->idle_action_event_source); sd_event_source_unref(m->inhibit_timeout_source); sd_event_source_unref(m->scheduled_shutdown_timeout_source); @@ -629,17 +624,6 @@ static int manager_connect_bus(Manager *m) { r = sd_bus_add_match(m->bus, NULL, "type='signal'," - "sender='org.freedesktop.DBus'," - "interface='org.freedesktop.DBus'," - "member='NameOwnerChanged'," - "path='/org/freedesktop/DBus'", - match_name_owner_changed, m); - if (r < 0) - return log_error_errno(r, "Failed to add match for NameOwnerChanged: %m"); - - r = sd_bus_add_match(m->bus, - NULL, - "type='signal'," "sender='org.freedesktop.systemd1'," "interface='org.freedesktop.systemd1.Manager'," "member='JobRemoved'," |