From: Timo Sirainen Date: Tue, 19 Oct 2010 18:27:59 +0000 (+0100) Subject: ioloop: If io_add() is called twice for same fd, give a bit more informative panic... X-Git-Tag: 2.0.6~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b6f56900570900cf7eb0282ff7d7885c4316dfa;p=thirdparty%2Fdovecot%2Fcore.git ioloop: If io_add() is called twice for same fd, give a bit more informative panic message. --- diff --git a/src/lib/ioloop-iolist.c b/src/lib/ioloop-iolist.c index 2e8fd17e78..4a4be299ed 100644 --- a/src/lib/ioloop-iolist.c +++ b/src/lib/ioloop-iolist.c @@ -22,6 +22,11 @@ bool ioloop_iolist_add(struct io_list *list, struct io_file *io) i_unreached(); } + if (list->ios[idx] != NULL) { + i_panic("io_add(0x%x) called twice fd=%d, callback=%p -> %p", + io->io.condition, io->fd, list->ios[idx]->io.callback, + io->io.callback); + } i_assert(list->ios[idx] == NULL); list->ios[idx] = io;