diff options
author | Lennart Poettering <lennart@poettering.net> | 2014-05-15 01:15:30 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-05-15 01:15:30 +0200 |
commit | 19befb2d5fc087f96e40ddc432b2cc9385666209 (patch) | |
tree | 4a28a54ed25ba8fb57578f639b2691749c9c935e /src/login/logind.c | |
parent | 9a78148e40402b44f361f4fbf63bb97a21aeac0b (diff) |
sd-bus: introduce sd_bus_slot objects encapsulating callbacks or vtables attached to a bus connection
This makes callback behaviour more like sd-event or sd-resolve, and
creates proper object for unregistering callbacks.
Taking the refernce to the slot is optional. If not taken life time of
the slot will be bound to the underlying bus object (or in the case of
an async call until the reply has been recieved).
Diffstat (limited to 'src/login/logind.c')
-rw-r--r-- | src/login/logind.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/login/logind.c b/src/login/logind.c index 86ce7df5d6..686506cc65 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -586,49 +586,50 @@ static int manager_connect_bus(Manager *m) { return r; } - r = sd_bus_add_object_vtable(m->bus, "/org/freedesktop/login1", "org.freedesktop.login1.Manager", manager_vtable, m); + r = sd_bus_add_object_vtable(m->bus, NULL, "/org/freedesktop/login1", "org.freedesktop.login1.Manager", manager_vtable, m); if (r < 0) { log_error("Failed to add manager object vtable: %s", strerror(-r)); return r; } - r = sd_bus_add_fallback_vtable(m->bus, "/org/freedesktop/login1/seat", "org.freedesktop.login1.Seat", seat_vtable, seat_object_find, m); + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/login1/seat", "org.freedesktop.login1.Seat", seat_vtable, seat_object_find, m); if (r < 0) { log_error("Failed to add seat object vtable: %s", strerror(-r)); return r; } - r = sd_bus_add_node_enumerator(m->bus, "/org/freedesktop/login1/seat", seat_node_enumerator, m); + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/login1/seat", seat_node_enumerator, m); if (r < 0) { log_error("Failed to add seat enumerator: %s", strerror(-r)); return r; } - r = sd_bus_add_fallback_vtable(m->bus, "/org/freedesktop/login1/session", "org.freedesktop.login1.Session", session_vtable, session_object_find, m); + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/login1/session", "org.freedesktop.login1.Session", session_vtable, session_object_find, m); if (r < 0) { log_error("Failed to add session object vtable: %s", strerror(-r)); return r; } - r = sd_bus_add_node_enumerator(m->bus, "/org/freedesktop/login1/session", session_node_enumerator, m); + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/login1/session", session_node_enumerator, m); if (r < 0) { log_error("Failed to add session enumerator: %s", strerror(-r)); return r; } - r = sd_bus_add_fallback_vtable(m->bus, "/org/freedesktop/login1/user", "org.freedesktop.login1.User", user_vtable, user_object_find, m); + r = sd_bus_add_fallback_vtable(m->bus, NULL, "/org/freedesktop/login1/user", "org.freedesktop.login1.User", user_vtable, user_object_find, m); if (r < 0) { log_error("Failed to add user object vtable: %s", strerror(-r)); return r; } - r = sd_bus_add_node_enumerator(m->bus, "/org/freedesktop/login1/user", user_node_enumerator, m); + r = sd_bus_add_node_enumerator(m->bus, NULL, "/org/freedesktop/login1/user", user_node_enumerator, m); if (r < 0) { log_error("Failed to add user enumerator: %s", strerror(-r)); return r; } r = sd_bus_add_match(m->bus, + NULL, "type='signal'," "sender='org.freedesktop.DBus'," "interface='org.freedesktop.DBus'," @@ -641,6 +642,7 @@ static int manager_connect_bus(Manager *m) { } r = sd_bus_add_match(m->bus, + NULL, "type='signal'," "sender='org.freedesktop.systemd1'," "interface='org.freedesktop.systemd1.Manager'," @@ -653,6 +655,7 @@ static int manager_connect_bus(Manager *m) { } r = sd_bus_add_match(m->bus, + NULL, "type='signal'," "sender='org.freedesktop.systemd1'," "interface='org.freedesktop.systemd1.Manager'," @@ -665,6 +668,7 @@ static int manager_connect_bus(Manager *m) { } r = sd_bus_add_match(m->bus, + NULL, "type='signal'," "sender='org.freedesktop.systemd1'," "interface='org.freedesktop.DBus.Properties'," @@ -676,6 +680,7 @@ static int manager_connect_bus(Manager *m) { } r = sd_bus_add_match(m->bus, + NULL, "type='signal'," "sender='org.freedesktop.systemd1'," "interface='org.freedesktop.systemd1.Manager'," |