[dovecot-cvs] dovecot/src/lib ioloop-notify-dn.c, 1.15.2.1, 1.15.2.2

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


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

Modified Files:
      Tag: branch_1_0
	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.15.2.1
retrieving revision 1.15.2.2
diff -u -d -r1.15.2.1 -r1.15.2.2
--- ioloop-notify-dn.c	10 Aug 2006 15:54:23 -0000	1.15.2.1
+++ ioloop-notify-dn.c	17 Jan 2007 17:59:09 -0000	1.15.2.2
@@ -85,7 +85,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");
@@ -95,10 +95,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