diff options
Diffstat (limited to 'src/libsystemd-bus')
-rw-r--r-- | src/libsystemd-bus/bus-internal.h | 2 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 23 |
2 files changed, 19 insertions, 6 deletions
diff --git a/src/libsystemd-bus/bus-internal.h b/src/libsystemd-bus/bus-internal.h index 913f281316..2112a29687 100644 --- a/src/libsystemd-bus/bus-internal.h +++ b/src/libsystemd-bus/bus-internal.h @@ -247,6 +247,8 @@ struct sd_bus { sd_event_source *time_event_source; sd_event_source *quit_event_source; sd_event *event; + + sd_bus_message *current; }; #define BUS_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC)) diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index a9f238ef22..e68f127b70 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -1931,6 +1931,7 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { assert(bus); assert(m); + bus->current = m; bus->iteration_counter++; log_debug("Got message sender=%s object=%s interface=%s member=%s", @@ -1941,25 +1942,29 @@ static int process_message(sd_bus *bus, sd_bus_message *m) { r = process_hello(bus, m); if (r != 0) - return r; + goto finish; r = process_reply(bus, m); if (r != 0) - return r; + goto finish; r = process_filter(bus, m); if (r != 0) - return r; + goto finish; r = process_match(bus, m); if (r != 0) - return r; + goto finish; r = process_builtin(bus, m); if (r != 0) - return r; + goto finish; + + r = bus_process_object(bus, m); - return bus_process_object(bus, m); +finish: + bus->current = NULL; + return r; } static int process_running(sd_bus *bus, sd_bus_message **ret) { @@ -2422,3 +2427,9 @@ int sd_bus_detach_event(sd_bus *bus) { return 0; } + +sd_bus_message* sd_bus_get_current(sd_bus *bus) { + assert_return(bus, NULL); + + return bus->current; +} |