]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
bugfix
authorTimo Sirainen <tss@iki.fi>
Mon, 26 May 2003 13:07:12 +0000 (16:07 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 26 May 2003 13:07:12 +0000 (16:07 +0300)
--HG--
branch : HEAD

src/lib/ioloop-poll.c

index 3ef56b09714ea18260955ca8ce09558779f320c1..bb1600ceba6fb5ff9037bf8028af7d545f848bdc 100644 (file)
@@ -186,13 +186,11 @@ void io_loop_handler_run(struct ioloop *ioloop)
 
                pollfd = &data->fds[data->fd_index[io->fd]];
                if (pollfd->revents != 0) {
-                       ret--;
-
                        if (pollfd->revents & POLLNVAL) {
                                i_error("invalid I/O fd %d, callback %p",
                                        io->fd, (void *) io->callback);
                                pollfd->events &= ~POLLNVAL;
-                               pollfd->revents &= ~POLLNVAL;
+                               pollfd->revents = 0;
                                call = FALSE;
                        } else if ((io->condition &
                                    (IO_READ|IO_WRITE)) == (IO_READ|IO_WRITE)) {
@@ -208,6 +206,9 @@ void io_loop_handler_run(struct ioloop *ioloop)
                                call = FALSE;
                        }
 
+                       if (pollfd->revents == 0)
+                               ret--;
+
                        if (call) {
                                t_id = t_push();
                                io->callback(io->context);