summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-objects.c
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2015-07-24 22:22:54 +1000
committerdaurnimator <quae@daurnimator.com>2015-07-24 22:22:54 +1000
commit09c8a7c63c431b70e373a25e2de3bdcad3cda608 (patch)
tree1a7838c82ac68655f52a1ad1cce6a7d40647adb6 /src/libsystemd/sd-bus/bus-objects.c
parent6cb22db3307d09803cd946763d9fbd60ea5b6664 (diff)
sd-bus: add 'offset' member for vtable methods
Defaults to zero, which retains the current behaviour. Fixes #577
Diffstat (limited to 'src/libsystemd/sd-bus/bus-objects.c')
-rw-r--r--src/libsystemd/sd-bus/bus-objects.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
index cbdf6552f9..a973bca84c 100644
--- a/src/libsystemd/sd-bus/bus-objects.c
+++ b/src/libsystemd/sd-bus/bus-objects.c
@@ -68,6 +68,12 @@ static int node_vtable_get_userdata(
return 1;
}
+static void *vtable_method_convert_userdata(const sd_bus_vtable *p, void *u) {
+ assert(p);
+
+ return (uint8_t*) u + p->x.method.offset;
+}
+
static void *vtable_property_convert_userdata(const sd_bus_vtable *p, void *u) {
assert(p);
@@ -360,6 +366,8 @@ static int method_callbacks_run(
if (bus->nodes_modified)
return 0;
+ u = vtable_method_convert_userdata(c->vtable, u);
+
*found_object = true;
if (c->last_iteration == bus->iteration_counter)