diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2008-02-11 18:23:40 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2008-02-11 18:23:40 +0100 |
commit | 6737f1ad17b78496e86dde8b97a531d171f79213 (patch) | |
tree | 1899e37b24bf4d41ba812350c2f44651de5b5dd7 | |
parent | 773a28080cf129b96c760fbcb515ba389c58ccbf (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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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) |