diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-30 16:34:06 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-05-30 17:34:34 +0200 |
commit | 7ae497b936998af6b16f746bd9695d16488b50cc (patch) | |
tree | f20e8293f915883fc5e88b7c93e7c31724895313 /src/libsystemd | |
parent | man: document the new sd_bus_slot_set_floating() call (diff) | |
download | systemd-7ae497b936998af6b16f746bd9695d16488b50cc.tar.gz systemd-7ae497b936998af6b16f746bd9695d16488b50cc.tar.bz2 systemd-7ae497b936998af6b16f746bd9695d16488b50cc.zip |
bus-slot: for bus slot objects with no explicit description use the match string as description
Let's make debugging a but easier with implicit descriptions for some
match objects.
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-bus/bus-slot.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libsystemd/sd-bus/bus-slot.c b/src/libsystemd/sd-bus/bus-slot.c index 3e592e3a2..34cfdd29e 100644 --- a/src/libsystemd/sd-bus/bus-slot.c +++ b/src/libsystemd/sd-bus/bus-slot.c @@ -300,8 +300,13 @@ _public_ int sd_bus_slot_set_description(sd_bus_slot *slot, const char *descript _public_ int sd_bus_slot_get_description(sd_bus_slot *slot, const char **description) { assert_return(slot, -EINVAL); assert_return(description, -EINVAL); - assert_return(slot->description, -ENXIO); - *description = slot->description; + if (slot->description) + *description = slot->description; + else if (slot->type == BUS_MATCH_CALLBACK) + *description = slot->match_callback.match_string; + else + return -ENXIO; + return 0; } |