summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-05 20:51:49 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-05 20:51:49 +0100
commitaffff0b6f2b267254fee981a010e06cd55d9756a (patch)
treea31947327ece1e58a7e9e6eef868fa30f5e54c64 /src/libsystemd-bus/sd-bus.c
parent4e724d9c5ab76c3f8327945317463ef706011082 (diff)
bus: add sd_bus_get_current() bus call to determine message that is currently being dispatched
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c23
1 files changed, 17 insertions, 6 deletions
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;
+}