diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2009-01-26 00:14:56 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2009-01-26 00:14:56 +0100 |
commit | 56d64ae30089e7d5370057655ac198e7ada785e5 (patch) | |
tree | 14196950812dced59dbc8624ca56ed245cef350b | |
parent | 707761e5dcaccef569c2e36cf5fbac9a74817e9d (diff) |
inotail.c: More graceful error handling in watch_file()
Extracted from the patch by Joe Pelkey
-rw-r--r-- | inotail.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -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; |