if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return -sd_bus_error_get_errno(error);
if (r == 0)
return r;
}
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return -sd_bus_error_get_errno(error);
STRV_FOREACH(k, children) {
if (r < 0) {
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return -sd_bus_error_get_errno(error);
return r;
}
if (r < 0)
return r;
if (sd_bus_error_is_set(error))
- return sd_bus_error_get_errno(error);
+ return -sd_bus_error_get_errno(error);
return r;
}
assert(path);
assert(c);
+ if (c->vtable[0].flags & SD_BUS_VTABLE_HIDDEN)
+ return 1;
+
for (v = c->vtable+1; v->type != _SD_BUS_VTABLE_END; v++) {
if (v->type != _SD_BUS_VTABLE_PROPERTY && v->type != _SD_BUS_VTABLE_WRITABLE_PROPERTY)
continue;
+ if (v->flags & SD_BUS_VTABLE_HIDDEN)
+ continue;
+
r = sd_bus_message_open_container(reply, 'e', "sv");
if (r < 0)
return r;
empty = false;
+ if (c->vtable[0].flags & SD_BUS_VTABLE_HIDDEN)
+ continue;
+
if (!streq_ptr(previous_interface, c->interface)) {
if (previous_interface)
if (hashmap_isempty(bus->nodes))
return 0;
+ /* Never respond to broadcast messages */
+ if (bus->bus_client && !m->destination)
+ return 0;
+
assert(m->path);
assert(m->member);
static struct node *bus_node_allocate(sd_bus *bus, const char *path) {
struct node *n, *parent;
const char *e;
- char *s, *p;
+ _cleanup_free_ char *s = NULL;
+ char *p;
int r;
assert(bus);
p = strndupa(path, MAX(1, path - e));
parent = bus_node_allocate(bus, p);
- if (!parent) {
- free(s);
+ if (!parent)
return NULL;
- }
}
n = new0(struct node, 1);
n->parent = parent;
n->path = s;
+ s = NULL; /* do not free */
- r = hashmap_put(bus->nodes, s, n);
+ r = hashmap_put(bus->nodes, n->path, n);
if (r < 0) {
- free(s);
+ free(n->path);
free(n);
return NULL;
}