From 347124f77d9502a21652bff4868f7c53052a8fca Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 12 Jun 2007 18:32:18 +0200 Subject: inotail.c: Also handle EAGAIN in watch_files() --- inotail.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 68f75c0..2790005 100644 --- a/inotail.c +++ b/inotail.c @@ -379,12 +379,12 @@ static int watch_files(struct file_struct *files, int n_files) ssize_t len; int ev_idx = 0; - /* Keep trying in the case of EINTR */ + /* Keep trying in the case of EINTR or EAGAIN*/ for (;;) { len = read(ifd, buf, (n_files * INOTIFY_BUFLEN)); if (unlikely(len < 0)) { /* Some form of signal, likely ^Z/fg's STOP and CONT interrupted the inotify read, retry */ - if (errno == EINTR) + if (errno == EINTR || errno == EAGAIN) continue; else { fprintf(stderr, "Error: Could not read inotify events (%s)\n", strerror(errno)); -- cgit v1.2.3-54-g00ecf