From 10e890d0eb9ad567f859d0470a7a001c819a9fcb Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sun, 13 Aug 2006 18:04:04 +0200 Subject: Small cleanups * Check for VERSION being set from Makefile * Remove needless code --- inotail.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'inotail.c') diff --git a/inotail.c b/inotail.c index 4baaa9e..8618a20 100644 --- a/inotail.c +++ b/inotail.c @@ -38,6 +38,9 @@ #include "inotail.h" #define PROGRAM_NAME "inotail" +#ifndef VERSION +#define VERSION "undef" +#endif #define BUFFER_SIZE 4096 @@ -81,11 +84,8 @@ static off_t lines_to_offset(struct file_struct *f, unsigned int n_lines) memset(&buf, 0, sizeof(buf)); - /* Negative offsets don't make sense here */ - if (offset < 0) - offset = 0; - - n_lines += 1; /* We also count the last \n */ + /* We also count the last \n */ + n_lines += 1; while (offset > 0 && n_lines > 0) { int rc; @@ -206,7 +206,6 @@ static int watch_files(struct file_struct *f, int n_files) } /* XXX: Is it possible that no file in the list produced the event? */ - if (inev->mask & IN_MODIFY) { int block_size; char fbuf[BUFFER_SIZE]; -- cgit v1.2.3-54-g00ecf