[dovecot-cvs] dovecot/src/lib ioloop.c,1.35.2.2,1.35.2.3

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


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

Modified Files:
      Tag: branch_1_0
	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.35.2.2
retrieving revision 1.35.2.3
diff -u -d -r1.35.2.2 -r1.35.2.3
--- ioloop.c	17 Aug 2006 21:16:48 -0000	1.35.2.2
+++ ioloop.c	15 Feb 2007 13:57:04 -0000	1.35.2.3
@@ -48,7 +48,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;
@@ -310,7 +313,6 @@
 	ioloop->pool = pool;
 
 	io_loop_handler_init(ioloop);
-	io_loop_notify_handler_init(ioloop);
 
 	ioloop->prev = current_ioloop;
         current_ioloop = ioloop;
@@ -325,7 +327,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