summaryrefslogtreecommitdiffstats
path: root/src/libsystemd/sd-bus/test-bus-objects.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-07-09 13:27:57 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-07-09 13:30:16 +0200
commit92d16a53e385781a55d9231d9f8f89c1747ab0e4 (patch)
treea303674fb19ba1bc5bc6a6fe580e4f521762c4e4 /src/libsystemd/sd-bus/test-bus-objects.c
parentMerge pull request #526 from phomes/master (diff)
downloadsystemd-92d16a53e385781a55d9231d9f8f89c1747ab0e4.tar.xz
systemd-92d16a53e385781a55d9231d9f8f89c1747ab0e4.zip
sd-bus: include queried path in GetManagedObjects
If GetManagedObjects is called on /foo/bar, then it should also include the object /foo/bar, if it exists. Right now, we only include objects underneath /foo/bar/. This follows the behavior of existing dbus implementations. Obsoletes #527 and fixes #525. Reported by: Nathaniel McCallum
Diffstat (limited to 'src/libsystemd/sd-bus/test-bus-objects.c')
-rw-r--r--src/libsystemd/sd-bus/test-bus-objects.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c
index 52952603e4..1db67ecfac 100644
--- a/src/libsystemd/sd-bus/test-bus-objects.c
+++ b/src/libsystemd/sd-bus/test-bus-objects.c
@@ -115,14 +115,13 @@ static int set_handler(sd_bus *bus, const char *path, const char *interface, con
static int value_handler(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error) {
_cleanup_free_ char *s = NULL;
- const char *x;
int r;
assert_se(asprintf(&s, "object %p, path %s", userdata, path) >= 0);
r = sd_bus_message_append(reply, "s", s);
assert_se(r >= 0);
- assert_se(x = startswith(path, "/value/"));
+ assert_se(startswith(path, "/value/") != NULL || strcmp(path, "/value") == 0);
assert_se(PTR_TO_UINT(userdata) == 30);