[dovecot-cvs] dovecot/src/lib ioloop-notify-dn.c,1.17,1.18

tss at dovecot.org tss at dovecot.org
Wed Jan 17 17:59:16 UTC 2007


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

Modified Files:
	ioloop-notify-dn.c 
Log Message:
Disable dnotify silently if it's not supported by the kernel. We were
missing one check.



Index: ioloop-notify-dn.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop-notify-dn.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ioloop-notify-dn.c	15 Dec 2006 16:55:32 -0000	1.17
+++ ioloop-notify-dn.c	17 Jan 2007 17:59:13 -0000	1.18
@@ -84,7 +84,7 @@
 
 	if (fcntl(fd, F_SETSIG, SIGRTMIN) < 0) {
 		if (errno == EINVAL) {
-			/* dnotify not in kernel. disable it. */
+			/* not supported, disable dnotify */
 			ctx->disabled = TRUE;
 		} else {
 			i_error("fcntl(F_SETSIG) failed: %m");
@@ -94,10 +94,15 @@
 	}
 	if (fcntl(fd, F_NOTIFY, DN_CREATE | DN_DELETE | DN_RENAME |
 		  DN_MULTISHOT) < 0) {
-		/* we fail here if we're trying to add dnotify to
-		   non-directory fd. fail silently in that case. */
-		if (errno != ENOTDIR)
+		if (errno == ENOTDIR) {
+			/* we're trying to add dnotify to a non-directory fd.
+			   fail silently. */
+		} else if (errno == EINVAL) {
+			/* dnotify not in kernel. disable it. */
+			ctx->disabled = TRUE;
+		} else {
 			i_error("fcntl(F_NOTIFY) failed: %m");
+		}
 		(void)fcntl(fd, F_SETSIG, 0);
 		(void)close(fd);
 		return NULL;



More information about the dovecot-cvs mailing list