diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-06-12 18:32:18 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-06-12 18:32:18 +0200 |
commit | 347124f77d9502a21652bff4868f7c53052a8fca (patch) | |
tree | d2d4834ba90c5a4c66e3b9890fe1893b41f53752 /inotail.c | |
parent | 4b51d764955cf09604fffadad9b9b88c72ab45db (diff) |
inotail.c: Also handle EAGAIN in watch_files()
Diffstat (limited to 'inotail.c')
-rw-r--r-- | inotail.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); |