mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-06 13:17:44 +03:00
sd-event: don't invalidate source type on disconnect
This fixes fd closing if fd ownership is requested.
This commit is contained in:
parent
b7db8b7b13
commit
f598255951
@ -771,11 +771,13 @@ static void source_disconnect(sd_event_source *s) {
|
||||
|
||||
event = s->event;
|
||||
|
||||
s->type = _SOURCE_EVENT_SOURCE_TYPE_INVALID;
|
||||
s->event = NULL;
|
||||
LIST_REMOVE(sources, event->sources, s);
|
||||
event->n_sources--;
|
||||
|
||||
/* Note that we don't invalidate the type here, since we still need it in order to close the fd or
|
||||
* pidfd associated with this event source, which we'll do only on source_free(). */
|
||||
|
||||
if (!s->floating)
|
||||
sd_event_unref(event);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user