summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2008-02-11 18:23:40 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2008-02-11 18:23:40 +0100
commit6737f1ad17b78496e86dde8b97a531d171f79213 (patch)
tree1899e37b24bf4d41ba812350c2f44651de5b5dd7
parent773a28080cf129b96c760fbcb515ba389c58ccbf (diff)
inotail.c: Check ignore flag before ignoreing the file
This makes ignore_file reentrant. Calling the function on a file which is already ignored shouldn't lead to n_ignored getting incremented.
-rw-r--r--inotail.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/inotail.c b/inotail.c
index fcf9185..aa11a8c 100644
--- a/inotail.c
+++ b/inotail.c
@@ -105,8 +105,10 @@ static void ignore_file(struct file_struct *f)
close(f->fd);
f->fd = -1;
}
- f->ignore = 1;
- n_ignored++;
+ if (!f->ignore) {
+ f->ignore = 1;
+ n_ignored++;
+ }
}
static inline char *pretty_name(char *filename)