From b0d08707bf440bd6cbd56703412659cff63df6f4 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 10 Jan 2007 21:41:24 +0100 Subject: inotail.c: Minor cleanups Make one more read(2) return value ssize_t and do not initialize n_files to 0 --- inotail.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inotail.c b/inotail.c index ebf2a40..e6f8f08 100644 --- a/inotail.c +++ b/inotail.c @@ -282,7 +282,7 @@ static int handle_inotify_event(struct inotify_event *inev, struct file_struct * int ret = 0; if (inev->mask & IN_MODIFY) { - int rc; + ssize_t rc; off_t offset; char fbuf[BUFFER_SIZE]; struct stat finfo; @@ -309,7 +309,7 @@ static int handle_inotify_event(struct inotify_event *inev, struct file_struct * lseek(f->fd, offset, SEEK_SET); while ((rc = read(f->fd, &fbuf, BUFFER_SIZE)) != 0) - write(STDOUT_FILENO, fbuf, rc); + write(STDOUT_FILENO, fbuf, (size_t) rc); #if 0 close(f->fd); #endif @@ -397,7 +397,7 @@ static int watch_files(struct file_struct *files, int n_files) int main(int argc, char **argv) { int i, c, ret = 0; - int n_files = 0; + int n_files; int n_units = DEFAULT_N_LINES; char forever = 0, mode = M_LINES; char **filenames; -- cgit v1.2.3-54-g00ecf