From: Timo Sirainen Date: Tue, 20 Sep 2011 10:30:08 +0000 (+0300) Subject: inotify: If read() fails with EAGAIN, ignore it instead of dying. X-Git-Tag: 2.1.beta1~161 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d6a6eccd3f2e34df967b90bb45e20755241bdbb;p=thirdparty%2Fdovecot%2Fcore.git inotify: If read() fails with EAGAIN, ignore it instead of dying. --- diff --git a/src/lib/ioloop-notify-inotify.c b/src/lib/ioloop-notify-inotify.c index d2f1d0b990..f0915864fb 100644 --- a/src/lib/ioloop-notify-inotify.c +++ b/src/lib/ioloop-notify-inotify.c @@ -45,7 +45,7 @@ static bool inotify_input_more(struct ioloop *ioloop) only full events are returned by the kernel. */ ret = read(ctx->inotify_fd, event_buf, sizeof(event_buf)); if (ret <= 0) { - if (ret == 0) { + if (ret == 0 || errno == EAGAIN) { /* nothing more to read */ return FALSE; }