Skip to content

Commit b168d6f

Browse files
poetteringbluca
authored andcommitted
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 7b4b3a8) (cherry picked from commit b2751b9) (cherry picked from commit 03d691f)
1 parent 238f1f1 commit b168d6f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/shared/varlink.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,8 @@ int varlink_get_events(Varlink *v) {
12981298
ret |= EPOLLIN;
12991299

13001300
if (!v->write_disconnected &&
1301-
v->output_buffer_size > 0)
1301+
(v->output_queue ||
1302+
v->output_buffer_size > 0))
13021303
ret |= EPOLLOUT;
13031304

13041305
return ret;

0 commit comments

Comments
 (0)