]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Clear old poll revents when removing the IO. Just extra sanity check.
authorTimo Sirainen <tss@iki.fi>
Fri, 23 May 2003 13:54:51 +0000 (16:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 23 May 2003 13:54:51 +0000 (16:54 +0300)
--HG--
branch : HEAD

src/lib/ioloop-poll.c

index 3c1997d6b4f676b60e6a2e8939056f6e0e83b0eb..65cc2805e38e6189ce619afab5091ec11f591033 100644 (file)
@@ -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 */