sd-bus: make sd_bus_is_{ready,open} accept NULL
We didn't document this behaviour one way or another, so I think it's OK to change. All callers do the NULL check before callling this to avoid the assert warning, so it seems reasonable to do it internally. sd_bus_can_send() is similar, but there we expressly say that an error is returned on NULL, so I didn't change it.
This commit is contained in:
@@ -1800,7 +1800,9 @@ void bus_enter_closing(sd_bus *bus) {
|
||||
DEFINE_PUBLIC_TRIVIAL_REF_UNREF_FUNC(sd_bus, sd_bus, bus_free);
|
||||
|
||||
_public_ int sd_bus_is_open(sd_bus *bus) {
|
||||
assert_return(bus, -EINVAL);
|
||||
if (!bus)
|
||||
return 0;
|
||||
|
||||
assert_return(bus = bus_resolve(bus), -ENOPKG);
|
||||
assert_return(!bus_pid_changed(bus), -ECHILD);
|
||||
|
||||
@@ -1808,7 +1810,9 @@ _public_ int sd_bus_is_open(sd_bus *bus) {
|
||||
}
|
||||
|
||||
_public_ int sd_bus_is_ready(sd_bus *bus) {
|
||||
assert_return(bus, -EINVAL);
|
||||
if (!bus)
|
||||
return 0;
|
||||
|
||||
assert_return(bus = bus_resolve(bus), -ENOPKG);
|
||||
assert_return(!bus_pid_changed(bus), -ECHILD);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user