From 2e402599bfb4c4e97a8f6f8b0910783c7a693aaf Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 13 Aug 2006 18:06:41 +0200 Subject: Alos check for fd when adding watch to file. --- inotail.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inotail.c') 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; } -- cgit v1.2.3-54-g00ecf