]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
ioloop-kqueue: Added extra assert.
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 08:38:07 +0000 (11:38 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Oct 2013 08:38:07 +0000 (11:38 +0300)
src/lib/ioloop-kqueue.c

index 1fc3c8fc3c5ceda1de9c5d7282cdbb3a3bafe528..e1a60f9f30854182434bfd24d4ce387c3435b0cb 100644 (file)
@@ -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