summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-slot.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-04 16:57:38 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-04 18:09:19 +0100
commit9cbfc66c621c42aa6e58e9e0da0adfb01efa7537 (patch)
tree5bac0472b33e87c1fc2eb808f7d6d921d818d630 /src/libsystemd/sd-bus/bus-slot.c
parentf1f00dbb7f3741b30d4a26b1a8b65ec46ff1fde3 (diff)
sd-bus: also allow setting descriptions on bus slots
Diffstat (limited to 'src/libsystemd/sd-bus/bus-slot.c')
-rw-r--r--src/libsystemd/sd-bus/bus-slot.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-slot.c b/src/libsystemd/sd-bus/bus-slot.c
index 568a6ed60c..8060e9882c 100644
--- a/src/libsystemd/sd-bus/bus-slot.c
+++ b/src/libsystemd/sd-bus/bus-slot.c
@@ -208,6 +208,7 @@ _public_ sd_bus_slot* sd_bus_slot_unref(sd_bus_slot *slot) {
}
bus_slot_disconnect(slot);
+ free(slot->description);
free(slot);
return NULL;
@@ -265,3 +266,18 @@ _public_ void* sd_bus_slot_get_current_userdata(sd_bus_slot *slot) {
return slot->bus->current_userdata;
}
+
+_public_ int sd_bus_slot_set_description(sd_bus_slot *slot, const char *description) {
+ assert_return(slot, -EINVAL);
+
+ return free_and_strdup(&slot->description, description);
+}
+
+_public_ int sd_bus_slot_get_description(sd_bus_slot *slot, char **description) {
+ assert_return(slot, -EINVAL);
+ assert_return(description, -EINVAL);
+ assert_return(slot->description, -ENXIO);
+
+ *description = slot->description;
+ return 0;
+}