diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-11-20 13:13:41 +0100 |
---|---|---|
committer | Luca Boccassi <luca.boccassi@gmail.com> | 2024-11-26 17:06:53 +0100 |
commit | 7b4b3a8f7b76f266438fafb225b7980db68a276e (patch) | |
tree | ca4974dab0720dc82226a04338ee407f02df125e /src | |
parent | man/systemd-system.conf: Correct "struct" to "strict" (#35364) (diff) | |
download | systemd-7b4b3a8f7b76f266438fafb225b7980db68a276e.tar.xz systemd-7b4b3a8f7b76f266438fafb225b7980db68a276e.zip |
sd-varlink: fix bug when enqueuing messages with fds asynchronously
When determining the poll events to wait for we need to take the queue
of pending messages that carry fds into account. Otherwise we might end
up not waking up if such an fd-carrying message is enqueued
asynchronously (i.e. not from a dispatch callback).
Diffstat (limited to 'src')
-rw-r--r-- | src/libsystemd/sd-varlink/sd-varlink.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-varlink/sd-varlink.c b/src/libsystemd/sd-varlink/sd-varlink.c index c7a8a504f2..150ce4edda 100644 --- a/src/libsystemd/sd-varlink/sd-varlink.c +++ b/src/libsystemd/sd-varlink/sd-varlink.c @@ -1698,7 +1698,8 @@ _public_ int sd_varlink_get_events(sd_varlink *v) { ret |= EPOLLIN; if (!v->write_disconnected && - v->output_buffer_size > 0) + (v->output_queue || + v->output_buffer_size > 0)) ret |= EPOLLOUT; return ret; |