1
0
mirror of https://github.com/gryf/wmaker.git synced 2026-01-31 04:55:54 +01:00

Fixed code in wevent.c to allow the callback handler to remove its InputHandler

if the peer closed connection.
This commit is contained in:
dan
1999-08-08 20:12:08 +00:00
parent b81ce0caa5
commit 124822d720

View File

@@ -784,6 +784,7 @@ W_WaitForEvent(Display *dpy, unsigned long xeventmask)
k = 1; k = 1;
while (handler) { while (handler) {
int mask; int mask;
InputHandler *next;
mask = 0; mask = 0;
@@ -795,13 +796,15 @@ W_WaitForEvent(Display *dpy, unsigned long xeventmask)
if (fds[k].revents & (POLLHUP | POLLNVAL | POLLERR)) if (fds[k].revents & (POLLHUP | POLLNVAL | POLLERR))
mask |= WIExceptMask; mask |= WIExceptMask;
next = handler->next;
if (mask!=0 && handler->callback) { if (mask!=0 && handler->callback) {
(*handler->callback)(handler->fd, mask, (*handler->callback)(handler->fd, mask,
handler->clientData); handler->clientData);
} }
handler = handler->next; handler = next;
k++; k++;
} }
} }
@@ -875,6 +878,7 @@ W_WaitForEvent(Display *dpy, unsigned long xeventmask)
while (handler) { while (handler) {
int mask; int mask;
InputHandler *next;
mask = 0; mask = 0;
@@ -886,13 +890,15 @@ W_WaitForEvent(Display *dpy, unsigned long xeventmask)
if (FD_ISSET(handler->fd, &eset)) if (FD_ISSET(handler->fd, &eset))
mask |= WIExceptMask; mask |= WIExceptMask;
next = handler->next;
if (mask!=0 && handler->callback) { if (mask!=0 && handler->callback) {
(*handler->callback)(handler->fd, mask, (*handler->callback)(handler->fd, mask,
handler->clientData); handler->clientData);
} }
handler = handler->next; handler = next;
} }
} }