[dovecot-cvs] dovecot/src/lib ioloop-notify-kqueue.c,1.5,1.6

cras at dovecot.org cras at dovecot.org
Sat Aug 26 16:55:06 EEST 2006


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

Modified Files:
	ioloop-notify-kqueue.c 
Log Message:
Fix 100% CPU usage looping when a vnode change event came but it was never
untriggered. Patch by Rui Lopes (rgl ruilopes com)



Index: ioloop-notify-kqueue.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-notify-kqueue.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ioloop-notify-kqueue.c	16 Aug 2006 17:58:02 -0000	1.5
+++ ioloop-notify-kqueue.c	26 Aug 2006 13:55:02 -0000	1.6
@@ -111,7 +111,10 @@
 	io->callback = callback;
 	io->context = context;
 
-	EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD,
+	/* EV_CLEAR flag is needed because the EVFILT_VNODE filter reports
+	   event state transitions and not the current state.  With this flag,
+	   the same event is only returned once. */
+	EV_SET(&ev, fd, EVFILT_VNODE, EV_ADD | EV_CLEAR,
 	       NOTE_DELETE | NOTE_WRITE | NOTE_EXTEND | NOTE_REVOKE, 0, io);
 	if (kevent(ctx->kq, &ev, 1, NULL, 0, NULL) < 0) {
 		i_error("kevent(%d, %s) for notify failed: %m", fd, path);



More information about the dovecot-cvs mailing list