[dovecot-cvs] dovecot/src/lib ioloop.c,1.38,1.39

tss at dovecot.org tss at dovecot.org
Thu Feb 15 13:57:11 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv26597

Modified Files:
	ioloop.c 
Log Message:
Delay initializing I/O notify backend until the first notify is added.
Non-IMAP processes never need notifies.



Index: ioloop.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- ioloop.c	15 Dec 2006 16:55:32 -0000	1.38
+++ ioloop.c	15 Feb 2007 13:57:08 -0000	1.39
@@ -50,7 +50,10 @@
 
 	i_assert(path != NULL);
 	i_assert(callback != NULL);
-	
+
+	if (current_ioloop->notify_handler_context == NULL)
+		io_loop_notify_handler_init(current_ioloop);
+
 	io = io_loop_notify_add(current_ioloop, path, callback, context);
 	if (io == NULL)
 		return NULL;
@@ -313,7 +316,6 @@
 	ioloop->pool = pool;
 
 	io_loop_handler_init(ioloop);
-	io_loop_notify_handler_init(ioloop);
 
 	ioloop->prev = current_ioloop;
         current_ioloop = ioloop;
@@ -328,7 +330,8 @@
 
 	*_ioloop = NULL;
 
-	io_loop_notify_handler_deinit(ioloop);
+	if (ioloop->notify_handler_context != NULL)
+		io_loop_notify_handler_deinit(ioloop);
 
 	while (ioloop->ios != NULL) {
 		struct io *io = ioloop->ios;



More information about the dovecot-cvs mailing list