From: Timo Sirainen Date: Wed, 23 Oct 2013 08:38:07 +0000 (+0300) Subject: ioloop-kqueue: Added extra assert. X-Git-Tag: 2.2.7~65 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1d00bd0bf4205166e66916facb3ca5b0be49dd28;p=thirdparty%2Fdovecot%2Fcore.git ioloop-kqueue: Added extra assert. --- diff --git a/src/lib/ioloop-kqueue.c b/src/lib/ioloop-kqueue.c index 1fc3c8fc3c..e1a60f9f30 100644 --- a/src/lib/ioloop-kqueue.c +++ b/src/lib/ioloop-kqueue.c @@ -85,6 +85,7 @@ void io_loop_handle_remove(struct io_file *io, bool closed) struct ioloop_handler_context *ctx = io->io.ioloop->handler_context; struct kevent ev; + i_assert(io->io.condition != 0); if ((io->io.condition & (IO_READ | IO_ERROR)) != 0 && !closed) { MY_EV_SET(&ev, io->fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) < 0) @@ -95,6 +96,7 @@ void io_loop_handle_remove(struct io_file *io, bool closed) if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) < 0) i_error("kevent(EV_DELETE, %d) failed: %m", io->fd); } + io->io.condition = 0; /* since we're not freeing memory in any case, just increase deleted counter so next handle_add() can just decrease it