sd-event: do not use assert_return for something that is not an error

It's totally OK for description to be unset, so let's not log about this
even at debug level.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2018-11-16 07:37:59 +01:00
parent a6da77b71b
commit 7d92a1a490
1 changed files with 3 additions and 1 deletions

View File

@ -1887,9 +1887,11 @@ _public_ int sd_event_source_set_description(sd_event_source *s, const char *des
_public_ int sd_event_source_get_description(sd_event_source *s, const char **description) {
assert_return(s, -EINVAL);
assert_return(description, -EINVAL);
assert_return(s->description, -ENXIO);
assert_return(!event_pid_changed(s->event), -ECHILD);
if (!s->description)
return -ENXIO;
*description = s->description;
return 0;
}