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.
This commit is contained in:
parent
1004b2c7bc
commit
7ae497b936
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue