changeset 1496:aa1e8b09b580 HEAD

Clear old poll revents when removing the IO. Just extra sanity check.
author Timo Sirainen <tss@iki.fi>
date Fri, 23 May 2003 16:54:51 +0300
parents 4d358048e9d7
children cdd898d549db
files src/lib/ioloop-poll.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-poll.c	Fri May 23 02:04:41 2003 +0300
+++ b/src/lib/ioloop-poll.c	Fri May 23 16:54:51 2003 +0300
@@ -123,10 +123,14 @@
 	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 */