summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@xenon.tklauser.home>2006-08-13 18:06:41 +0200
committerTobias Klauser <tklauser@xenon.tklauser.home>2006-08-13 18:06:41 +0200
commit2e402599bfb4c4e97a8f6f8b0910783c7a693aaf (patch)
tree40fd6943f67791ec5a71a905be65f7611aa55907
parentf4384fef0cc053417948713b3202262c264c4268 (diff)
Alos check for fd when adding watch to file.
-rw-r--r--inotail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index 8618a20..afcc1f7 100644
--- a/inotail.c
+++ b/inotail.c
@@ -199,7 +199,7 @@ static int watch_files(struct file_struct *f, int n_files)
/* Which file has produced the event? */
for (i = 0; i < n_files; i++) {
- if (!f[i].ignore && f[i].i_watch == inev->wd) {
+ if (!f[i].ignore && f[i].fd >= 0 && f[i].i_watch == inev->wd) {
fil = &f[i];
break;
}