diff options
author | Lennart Poettering <lennart@poettering.net> | 2018-05-30 16:34:06 +0200 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | d853931416364fe06a88b16f4222a42bb47ccca7 (patch) | |
tree | 5c214dc0b229ccbefcc52882b679decfdb80bce6 /src/libelogind/sd-bus | |
parent | b26856f052f63443124a779c0cafa5a222c762f1 (diff) |
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/libelogind/sd-bus')
-rw-r--r-- | src/libelogind/sd-bus/bus-slot.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libelogind/sd-bus/bus-slot.c b/src/libelogind/sd-bus/bus-slot.c index 3e592e3a2..34cfdd29e 100644 --- a/src/libelogind/sd-bus/bus-slot.c +++ b/src/libelogind/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; } |