chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: support implicit serialization of strv string arrays within vtables
[elogind.git]
/
src
/
libsystemd-bus
/
bus-objects.c
diff --git
a/src/libsystemd-bus/bus-objects.c
b/src/libsystemd-bus/bus-objects.c
index 05d0015902075850c6ce0b13480b63365a3dd038..92781e9adcc1ef2192c40c4657f9759b03632dd8 100644
(file)
--- a/
src/libsystemd-bus/bus-objects.c
+++ b/
src/libsystemd-bus/bus-objects.c
@@
-312,7
+312,6
@@
static int invoke_property_get(
sd_bus_error *error,
void *userdata) {
sd_bus_error *error,
void *userdata) {
- int r;
const void *p;
assert(bus);
const void *p;
assert(bus);
@@
-327,6
+326,9
@@
static int invoke_property_get(
/* Automatic handling if no callback is defined. */
/* Automatic handling if no callback is defined. */
+ if (streq(v->x.property.signature, "as"))
+ return sd_bus_message_append_strv(m, *(char***) userdata);
+
assert(signature_is_single(v->x.property.signature, false));
assert(bus_type_is_basic(v->x.property.signature[0]));
assert(signature_is_single(v->x.property.signature, false));
assert(bus_type_is_basic(v->x.property.signature[0]));
@@
-347,11
+349,7
@@
static int invoke_property_get(
break;
}
break;
}
- r = sd_bus_message_append_basic(m, v->x.property.signature[0], p);
- if (r < 0)
- return r;
-
- return 1;
+ return sd_bus_message_append_basic(m, v->x.property.signature[0], p);
}
static int invoke_property_set(
}
static int invoke_property_set(
@@
-1587,7
+1585,7
@@
static int add_object_vtable_internal(
if (!member_name_is_valid(v->x.property.member) ||
!signature_is_single(v->x.property.signature, false) ||
if (!member_name_is_valid(v->x.property.member) ||
!signature_is_single(v->x.property.signature, false) ||
- !(v->x.property.get || bus_type_is_basic(v->x.property.signature[0])) ||
+ !(v->x.property.get || bus_type_is_basic(v->x.property.signature[0])
|| streq(v->x.property.signature, "as")
) ||
v->flags & SD_BUS_VTABLE_METHOD_NO_REPLY ||
(v->flags & SD_BUS_VTABLE_PROPERTY_INVALIDATE_ONLY && !(v->flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE))) {
r = -EINVAL;
v->flags & SD_BUS_VTABLE_METHOD_NO_REPLY ||
(v->flags & SD_BUS_VTABLE_PROPERTY_INVALIDATE_ONLY && !(v->flags & SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE))) {
r = -EINVAL;