From: Lennart Poettering Date: Wed, 20 Nov 2024 12:13:41 +0000 (+0100) Subject: sd-varlink: fix bug when enqueuing messages with fds asynchronously X-Git-Tag: v256.9~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b2751b9ae97704ca75fddf2dd79b3ad2605bf629;p=thirdparty%2Fsystemd.git 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). (cherry picked from commit 7b4b3a8f7b76f266438fafb225b7980db68a276e) --- diff --git a/src/shared/varlink.c b/src/shared/varlink.c index 0a6d2c822f5..ec9284792a7 100644 --- a/src/shared/varlink.c +++ b/src/shared/varlink.c @@ -1708,7 +1708,8 @@ int varlink_get_events(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;