summaryrefslogtreecommitdiff
path: root/inotail.c
diff options
context:
space:
mode:
Diffstat (limited to 'inotail.c')
-rw-r--r--inotail.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/inotail.c b/inotail.c
index 55fa532..8ff7773 100644
--- a/inotail.c
+++ b/inotail.c
@@ -716,10 +716,15 @@ static int watch_files(struct file_struct *files, int n_files)
}
}
- if (unlikely(!f))
- break;
+ /* Spurious event */
+ if (unlikely(!f)) {
+ ev_idx += sizeof(struct inotify_event) + inev->len;
+ continue;
+ }
- if (handle_inotify_event(inev, f) < 0)
+ if (handle_inotify_event(inev, f) < 0 && n_ignored == n_files)
+ /* Got an error handling the event and no files
+ * left unignored */
break;
ev_idx += sizeof(struct inotify_event) + inev->len;