diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2009-01-25 19:02:23 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2009-01-25 19:02:23 +0100 |
commit | 7a1d9eb8e5c067d3e7935c8ca3aaf0535ed90661 (patch) | |
tree | a8853148f77d63ad4d4c686fb97071f293b041ba /inotail.c | |
parent | c954106d4388fd46f3387aae01e26ab0da993f9c (diff) |
Make sure that st_blksize is greater than 0
Diffstat (limited to 'inotail.c')
-rw-r--r-- | inotail.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -565,7 +565,8 @@ static int tail_file(struct file_struct *f, unsigned long n_units, mode_t mode, } f->size = finfo.st_size; - f->blksize = finfo.st_blksize; /* TODO: Can this value be 0? */ + if (likely(finfo.st_blksize > 0)) + f->blksize = finfo.st_blksize; if (mode == M_LINES) offset = lines_to_offset(f, n_units); |