From ec290fea4468a13a8019ce24b9bf2896f4725330 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 21 May 2007 23:45:41 +0200 Subject: Some housekeeping after introduction of alloc_buffer() --- inotail.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 9d5229e..4664a62 100644 --- a/inotail.c +++ b/inotail.c @@ -142,7 +142,7 @@ static off_t lines_to_offset_from_end(struct file_struct *f, unsigned long n_lin int i; ssize_t rc, block_size = f->st_blksize; /* Size of the current block we're reading */ - if (offset < f->st_blksize) + if (offset < block_size) block_size = offset; /* Start of current block */ @@ -176,13 +176,12 @@ static off_t lines_to_offset_from_begin(struct file_struct *f, unsigned long n_l char *buf; off_t offset = 0; - buf = alloc_buffer(f); - /* tail everything for 'inotail -n +0' */ if (n_lines == 0) return 0; n_lines--; + buf = alloc_buffer(f); while (offset <= f->st_size && n_lines > 0) { int i; -- cgit v1.2.3-54-g00ecf