diff options
author | Jan Klötzke <Jan.Kloetzke@preh.de> | 2018-01-11 10:42:27 +0100 |
---|---|---|
committer | Jan Klötzke <jan@kloetzke.net> | 2018-01-22 18:06:56 +0100 |
commit | 43ce15ac307fe87785f82391936842dd4f1402f3 (patch) | |
tree | 0991ade9e93f1c13f275430861e29c26c2df6687 /src/shared/bus-util.c | |
parent | 204d140c4def364c47d36226e4514a7e077fa196 (diff) | |
download | systemd-43ce15ac307fe87785f82391936842dd4f1402f3.tar.gz |
bus-util: add bool property setter
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index b6677e27f6..6b177afb8c 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1338,6 +1338,25 @@ int bus_property_get_bool( return sd_bus_message_append_basic(reply, 'b', &b); } +int bus_property_set_bool( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *value, + void *userdata, + sd_bus_error *error) { + + int b, r; + + r = sd_bus_message_read(value, "b", &b); + if (r < 0) + return r; + + *(bool *) userdata = !!b; + return 0; +} + int bus_property_get_id128( sd_bus *bus, const char *path, |