When a client is marked as write blocked, clear any old 'write ready'
bit in the osfds structure so that a new indication of write ready
(which is marked as edge trigggered) will trigger the callback.

Signed-off-by: Keith Packard <kei...@keithp.com>
---
 os/ospoll.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/os/ospoll.c b/os/ospoll.c
index b00d422..51bd02d 100644
--- a/os/ospoll.c
+++ b/os/ospoll.c
@@ -352,10 +352,14 @@ ospoll_listen(struct ospoll *ospoll, int fd, int xevents)
         epoll_mod(ospoll, osfd);
 #endif
 #if POLL
-        if (xevents & X_NOTIFY_READ)
+        if (xevents & X_NOTIFY_READ) {
             ospoll->fds[pos].events |= POLLIN;
-        if (xevents & X_NOTIFY_WRITE)
+            ospoll->osfds[pos].revents &= ~POLLIN;
+        }
+        if (xevents & X_NOTIFY_WRITE) {
             ospoll->fds[pos].events |= POLLOUT;
+            ospoll->osfds[pos].revents &= ~POLLOUT;
+        }
 #endif
     }
 }
-- 
2.9.3

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to