dovecot-2.2: ioloop-kqueue: Added extra assert.

dovecot at dovecot.org dovecot at dovecot.org
Wed Oct 23 11:38:21 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/10f3030047b6
changeset: 16864:10f3030047b6
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 23 11:38:07 2013 +0300
description:
ioloop-kqueue: Added extra assert.

diffstat:

 src/lib/ioloop-kqueue.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 72b3b8c86222 -r 10f3030047b6 src/lib/ioloop-kqueue.c
--- a/src/lib/ioloop-kqueue.c	Tue Oct 22 19:12:38 2013 +0300
+++ b/src/lib/ioloop-kqueue.c	Wed Oct 23 11:38:07 2013 +0300
@@ -85,6 +85,7 @@
 	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 @@
 		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


More information about the dovecot-cvs mailing list