diff -urpNX /usr/share/dontdiff dovecot-1.0-test32.vanilla/src/lib/ioloop.c dovecot-1.0-test32/src/lib/ioloop.c --- dovecot-1.0-test32.vanilla/src/lib/ioloop.c 2004-06-24 12:14:14.000000000 +0400 +++ dovecot-1.0-test32/src/lib/ioloop.c 2004-08-21 18:04:35.000000000 +0400 @@ -56,7 +56,7 @@ struct io *io_add(int fd, enum io_condit if (io->fd > current_ioloop->highest_fd) current_ioloop->highest_fd = io->fd; - io_loop_handle_add(current_ioloop, io->fd, io->condition); + io_loop_handle_add(current_ioloop, io); /* have to append it, or io_destroy() breaks */ io_p = ¤t_ioloop->ios; @@ -79,7 +79,7 @@ void io_remove(struct io *io) i_assert(io->fd <= current_ioloop->highest_fd); /* notify the real I/O handler */ - io_loop_handle_remove(current_ioloop, io->fd, io->condition); + io_loop_handle_remove(current_ioloop, io); io->destroyed = TRUE; diff -urpNX /usr/share/dontdiff dovecot-1.0-test32.vanilla/src/lib/ioloop-internal.h dovecot-1.0-test32/src/lib/ioloop-internal.h --- dovecot-1.0-test32.vanilla/src/lib/ioloop-internal.h 2003-09-07 05:52:06.000000000 +0400 +++ dovecot-1.0-test32/src/lib/ioloop-internal.h 2004-08-21 18:01:13.000000000 +0400 @@ -53,10 +53,8 @@ void io_destroy(struct ioloop *ioloop, s void timeout_destroy(struct ioloop *ioloop, struct timeout **timeout_p); /* I/O handler calls */ -void io_loop_handle_add(struct ioloop *ioloop, int fd, - enum io_condition condition); -void io_loop_handle_remove(struct ioloop *ioloop, int fd, - enum io_condition condition); +void io_loop_handle_add(struct ioloop *ioloop, struct io *io); +void io_loop_handle_remove(struct ioloop *ioloop, struct io *io); void io_loop_handler_init(struct ioloop *ioloop); void io_loop_handler_deinit(struct ioloop *ioloop); diff -urpNX /usr/share/dontdiff dovecot-1.0-test32.vanilla/src/lib/ioloop-poll.c dovecot-1.0-test32/src/lib/ioloop-poll.c --- dovecot-1.0-test32.vanilla/src/lib/ioloop-poll.c 2003-08-27 01:18:16.000000000 +0400 +++ dovecot-1.0-test32/src/lib/ioloop-poll.c 2004-08-21 18:46:22.000000000 +0400 @@ -45,12 +45,12 @@ void io_loop_handler_deinit(struct ioloo #define IO_POLL_INPUT (POLLIN|POLLPRI|POLLERR|POLLHUP|POLLNVAL) #define IO_POLL_OUTPUT (POLLOUT|POLLERR|POLLHUP|POLLNVAL) -void io_loop_handle_add(struct ioloop *ioloop, int fd, - enum io_condition condition) +void io_loop_handle_add(struct ioloop *ioloop, struct io *io) { struct ioloop_handler_data *data = ioloop->handler_data; + enum io_condition condition = io->condition; unsigned int old_size; - int index; + int index, fd = io->fd; if ((unsigned int) fd >= data->idx_size) { /* grow the fd -> index array */ @@ -97,11 +97,11 @@ void io_loop_handle_add(struct ioloop *i data->fds[index].events |= IO_POLL_OUTPUT; } -void io_loop_handle_remove(struct ioloop *ioloop, int fd, - enum io_condition condition) +void io_loop_handle_remove(struct ioloop *ioloop, struct io *io) { struct ioloop_handler_data *data = ioloop->handler_data; - int index; + enum io_condition condition = io->condition; + int index, fd = io->fd; index = data->fd_index[fd]; i_assert(index >= 0 && (unsigned int) index < data->fds_size); diff -urpNX /usr/share/dontdiff dovecot-1.0-test32.vanilla/src/lib/ioloop-select.c dovecot-1.0-test32/src/lib/ioloop-select.c --- dovecot-1.0-test32.vanilla/src/lib/ioloop-select.c 2003-08-27 01:18:16.000000000 +0400 +++ dovecot-1.0-test32/src/lib/ioloop-select.c 2004-08-21 18:28:38.000000000 +0400 @@ -30,9 +30,11 @@ void io_loop_handler_deinit(struct ioloo p_free(ioloop->pool, ioloop->handler_data); } -void io_loop_handle_add(struct ioloop *ioloop, int fd, - enum io_condition condition) +void io_loop_handle_add(struct ioloop *ioloop, struct io *io) { + enum io_condition condition = io->condition; + int fd = io->fd; + i_assert(fd >= 0); if (fd >= FD_SETSIZE) @@ -44,9 +46,11 @@ void io_loop_handle_add(struct ioloop *i FD_SET(fd, &ioloop->handler_data->write_fds); } -void io_loop_handle_remove(struct ioloop *ioloop, int fd, - enum io_condition condition) +void io_loop_handle_remove(struct ioloop *ioloop, struct io *io) { + enum io_condition condition = io->condition; + int fd = io->fd; + i_assert(fd >= 0 && fd < FD_SETSIZE); if (condition & IO_READ)