diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-05-21 23:45:41 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-05-21 23:45:41 +0200 |
commit | ec290fea4468a13a8019ce24b9bf2896f4725330 (patch) | |
tree | ce1feae8914aa9111f632830237ffa1498d614e9 | |
parent | 000fdf04a941b5d306c9c0cc54b9fce08b4379b8 (diff) |
Some housekeeping after introduction of alloc_buffer()
-rw-r--r-- | inotail.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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; |