summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-match.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-08-18 17:41:56 +0200
committerLennart Poettering <lennart@poettering.net>2014-08-18 17:49:53 +0200
commitcaa829849d6ac9f6e173f585f732054358311ae1 (patch)
treed4e90bf247457b9863f4465b82d8a855224e8bcd /src/libsystemd/sd-bus/bus-match.c
parentb5af2aca120f1bf13cffc270803c2232918dd967 (diff)
sd-bus: add API to query which handler/callback is currently being dispatched
Diffstat (limited to 'src/libsystemd/sd-bus/bus-match.c')
-rw-r--r--src/libsystemd/sd-bus/bus-match.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c
index 9e0769caa6..88b61a75be 100644
--- a/src/libsystemd/sd-bus/bus-match.c
+++ b/src/libsystemd/sd-bus/bus-match.c
@@ -294,11 +294,17 @@ int bus_match_run(
sd_bus_slot *slot;
slot = container_of(node->leaf.callback, sd_bus_slot, match_callback);
- if (bus)
+ if (bus) {
bus->current_slot = sd_bus_slot_ref(slot);
+ bus->current_handler = node->leaf.callback->callback;
+ bus->current_userdata = slot->userdata;
+ }
r = node->leaf.callback->callback(bus, m, slot->userdata, &error_buffer);
- if (bus)
+ if (bus) {
+ bus->current_userdata = NULL;
+ bus->current_handler = NULL;
bus->current_slot = sd_bus_slot_unref(slot);
+ }
r = bus_maybe_reply_error(m, r, &error_buffer);
if (r != 0)