diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-11-20 18:18:09 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-11-20 20:58:17 +0100 |
commit | 86befb4098e12688605a08bf602532de9a0ec863 (patch) | |
tree | 92c1d1360b604294c8cb8551790856d146284dd1 /src/libsystemd-bus/sd-bus.c | |
parent | 2576a19ed25dff1adc7fd2c0b874c74946fb35b4 (diff) |
bus: make sure an additional ref to a busevent source doesn't cause the event source to be triggered again
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c index bc88ac977c..72d04d28f1 100644 --- a/src/libsystemd-bus/sd-bus.c +++ b/src/libsystemd-bus/sd-bus.c @@ -2626,17 +2626,25 @@ _public_ int sd_bus_detach_event(sd_bus *bus) { assert_return(bus, -EINVAL); assert_return(bus->event, -ENXIO); - if (bus->input_io_event_source) + if (bus->input_io_event_source) { + sd_event_source_set_enabled(bus->input_io_event_source, SD_EVENT_OFF); bus->input_io_event_source = sd_event_source_unref(bus->input_io_event_source); + } - if (bus->output_io_event_source) + if (bus->output_io_event_source) { + sd_event_source_set_enabled(bus->output_io_event_source, SD_EVENT_OFF); bus->output_io_event_source = sd_event_source_unref(bus->output_io_event_source); + } - if (bus->time_event_source) + if (bus->time_event_source) { + sd_event_source_set_enabled(bus->time_event_source, SD_EVENT_OFF); bus->time_event_source = sd_event_source_unref(bus->time_event_source); + } - if (bus->quit_event_source) + if (bus->quit_event_source) { + sd_event_source_set_enabled(bus->quit_event_source, SD_EVENT_OFF); bus->quit_event_source = sd_event_source_unref(bus->quit_event_source); + } if (bus->event) bus->event = sd_event_unref(bus->event); |