From d5433918e5ea78035467ca1b955fe8dc8c93dda7 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 20 Sep 2006 18:41:06 +0200 Subject: Just tail everything in tail_pipe() for now --- inotail.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/inotail.c b/inotail.c index 7f191c6..da793db 100644 --- a/inotail.c +++ b/inotail.c @@ -138,11 +138,18 @@ static int bytes_to_offset(struct file_struct *f, int n_lines) return (ret < 0 ? 0 : ret); } -/* We will just tail everything here */ static int tail_pipe(struct file_struct *f) { + int rc; + char buf[BUFFER_SIZE]; + if (verbose) write_header(f->name); + + /* We will just tail everything here */ + while ((rc = read(f->fd, &buf, BUFFER_SIZE)) > 0) + write(STDOUT_FILENO, buf, (size_t) rc); + return 0; } -- cgit v1.2.3-54-g00ecf