diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-10-11 19:33:39 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-10-11 20:03:19 +0200 |
commit | 43a43f5016eb9404afdd6719b18f604a484535ec (patch) | |
tree | b9b693e25083913f9129291bee54749c5fdbc97c /src/libsystemd-bus/test-bus-objects.c | |
parent | 1a0464230c08506c3fd715ff7cc56660df3a85ca (diff) |
bus: automatically do a NOP reply when a NULL callback is specified for a method in a vtable
Also, allow specifiying NULL as signature in vtables equivalent to ""
for empty parameter lists.
Diffstat (limited to 'src/libsystemd-bus/test-bus-objects.c')
-rw-r--r-- | src/libsystemd-bus/test-bus-objects.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libsystemd-bus/test-bus-objects.c b/src/libsystemd-bus/test-bus-objects.c index 06947a2c18..637e0511b2 100644 --- a/src/libsystemd-bus/test-bus-objects.c +++ b/src/libsystemd-bus/test-bus-objects.c @@ -39,8 +39,6 @@ * Add in: * * automatic properties for Set() - * automatic NULL method - * allow NULL as signatures in vtable * node hierarchy updates during dispatching * emit_interfaces_added/emit_interfaces_removed * @@ -157,6 +155,7 @@ static const sd_bus_vtable vtable[] = { SD_BUS_WRITABLE_PROPERTY("Something", "s", get_handler, set_handler, 0, 0), SD_BUS_PROPERTY("AutomaticStringProperty", "s", NULL, offsetof(struct context, automatic_string_property), 0), SD_BUS_PROPERTY("AutomaticIntegerProperty", "u", NULL, offsetof(struct context, automatic_integer_property), 0), + SD_BUS_METHOD("NoOperation", "", "", NULL, 0), SD_BUS_VTABLE_END }; @@ -241,6 +240,9 @@ static int client(struct context *c) { assert_se(sd_bus_set_fd(bus, c->fds[1], c->fds[1]) >= 0); assert_se(sd_bus_start(bus) >= 0); + r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.systemd.test", "NoOperation", &error, NULL, NULL); + assert_se(r >= 0); + r = sd_bus_call_method(bus, "org.freedesktop.systemd.test", "/foo", "org.freedesktop.systemd.test", "AlterSomething", &error, &reply, "s", "hallo"); assert_se(r >= 0); |