changeset 5814:498ef9bc33f1 HEAD

If inotify_init() fails with EMFILE, give an understandable error message.
author Timo Sirainen <tss@iki.fi>
date Wed, 27 Jun 2007 22:46:21 +0300
parents 9b4987348cf6
children 3f1d268f32f0
files src/lib/ioloop-notify-inotify.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib/ioloop-notify-inotify.c	Wed Jun 27 22:37:17 2007 +0300
+++ b/src/lib/ioloop-notify-inotify.c	Wed Jun 27 22:46:21 2007 +0300
@@ -133,7 +133,12 @@
 
 	ctx->inotify_fd = inotify_init();
 	if (ctx->inotify_fd == -1) {
-		i_error("inotify_init() failed: %m");
+		if (errno != EMFILE)
+			i_error("inotify_init() failed: %m");
+		else {
+			i_warning("Inotify instance limit for user exceeded, "
+				  "disabling.");
+		}
 		ctx->disabled = TRUE;
 	} else {
 		fd_close_on_exec(ctx->inotify_fd, TRUE);