1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 01:27:11 +03:00

bus: don't generate assert warnings when we detach a detached bus from an event

This commit is contained in:
Lennart Poettering 2013-12-10 23:06:50 +00:00
parent 80caea6cc7
commit a82cafb97b

View File

@ -2645,7 +2645,9 @@ fail:
_public_ int sd_bus_detach_event(sd_bus *bus) {
assert_return(bus, -EINVAL);
assert_return(bus->event, -ENXIO);
if (!bus->event)
return 0;
if (bus->input_io_event_source) {
sd_event_source_set_enabled(bus->input_io_event_source, SD_EVENT_OFF);
@ -2670,7 +2672,7 @@ _public_ int sd_bus_detach_event(sd_bus *bus) {
if (bus->event)
bus->event = sd_event_unref(bus->event);
return 0;
return 1;
}
_public_ sd_event* sd_bus_get_event(sd_bus *bus) {