From: Timo Sirainen Date: Fri, 23 May 2003 13:54:51 +0000 (+0300) Subject: Clear old poll revents when removing the IO. Just extra sanity check. X-Git-Tag: 1.1.alpha1~4610 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a661087e4b5f8757882230173525d4229e61acc0;p=thirdparty%2Fdovecot%2Fcore.git Clear old poll revents when removing the IO. Just extra sanity check. --HG-- branch : HEAD --- diff --git a/src/lib/ioloop-poll.c b/src/lib/ioloop-poll.c index 3c1997d6b4..65cc2805e3 100644 --- a/src/lib/ioloop-poll.c +++ b/src/lib/ioloop-poll.c @@ -123,10 +123,14 @@ void io_loop_handle_remove(struct ioloop *ioloop, int fd, int condition) index = data->fd_index[fd]; i_assert(index >= 0 && (unsigned int) index < data->fds_size); - if (condition & IO_READ) + if (condition & IO_READ) { data->fds[index].events &= ~(POLLIN|POLLPRI); - if (condition & IO_WRITE) + data->fds[index].revents &= ~(POLLIN|POLLPRI); + } + if (condition & IO_WRITE) { data->fds[index].events &= ~POLLOUT; + data->fds[index].revents &= ~POLLOUT; + } if ((data->fds[index].events & (POLLIN|POLLOUT)) == 0) { /* remove the whole pollfd */