changeset 12314:f7f2edaf6dca

ioloop: If io_add() is called twice for same fd, give a bit more informative panic message.
author Timo Sirainen <tss@iki.fi>
date Tue, 19 Oct 2010 19:27:59 +0100
parents 0ac9af7f7d5b
children 5f9919f9e321
files src/lib/ioloop-iolist.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-iolist.c	Tue Oct 19 18:48:00 2010 +0100
+++ b/src/lib/ioloop-iolist.c	Tue Oct 19 19:27:59 2010 +0100
@@ -22,6 +22,11 @@
 		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;