mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 16:44:52 +00:00
os: Clear saved poll events in listen so that edge triggering works
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 <keithp@keithp.com> Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Tested-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com> Tested-by: Matthieu Herrb <matthieu@herrb.eu>
This commit is contained in:
committed by
Jeremy Huddleston Sequoia
parent
1d365f1ffe
commit
7ff8a74945
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user