dovecot-1.0: Ignore inotify_rm_watch() failing with EINVAL.

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 25 16:59:10 EEST 2007


details:   http://hg.dovecot.org/dovecot-1.0/rev/faf0bb8cd57d
changeset: 5357:faf0bb8cd57d
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 25 16:59:06 2007 +0300
description:
Ignore inotify_rm_watch() failing with EINVAL.

diffstat:

1 file changed, 2 insertions(+), 1 deletion(-)
src/lib/ioloop-notify-inotify.c |    3 ++-

diffs (13 lines):

diff -r a23be6956727 -r faf0bb8cd57d src/lib/ioloop-notify-inotify.c
--- a/src/lib/ioloop-notify-inotify.c	Tue Jul 24 05:48:03 2007 +0300
+++ b/src/lib/ioloop-notify-inotify.c	Wed Jul 25 16:59:06 2007 +0300
@@ -139,7 +139,8 @@ void io_loop_notify_remove(struct ioloop
 		ioloop->notify_handler_context;
 	struct inotify_io *io = (struct inotify_io *)_io;
 
-	if (inotify_rm_watch(ctx->inotify_fd, io->wd) < 0)
+	/* EINVAL happens if the watched file itself is deleted */
+	if (inotify_rm_watch(ctx->inotify_fd, io->wd) < 0 && errno != EINVAL)
 		i_error("inotify_rm_watch() failed: %m");
 
 	if (ioloop->notifys == NULL)


More information about the dovecot-cvs mailing list