From c5541f8a0814279e477b4c6199981bbe2d8575a4 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Thu, 5 May 2022 00:43:28 -0500 Subject: [PATCH] server: Don't poll for POLLOUT if there are alerted write asyncs. Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- server/sock.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/sock.c b/server/sock.c index 2bb2963a840..cb76765e495 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1315,7 +1315,12 @@ static int sock_get_poll_events( struct fd *fd ) if (async_queued( &sock->write_q )) { - if (async_waiting( &sock->write_q )) ev |= POLLOUT; + /* As with read asyncs above, clear POLLOUT if we have an alerted + * async. */ + if (async_waiting( &sock->write_q )) + ev |= POLLOUT; + else + ev &= ~POLLOUT; } else if (!sock->wr_shutdown && (mask & AFD_POLL_WRITE)) {