summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-01-10 21:41:24 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-01-10 21:41:24 +0100
commitb0d08707bf440bd6cbd56703412659cff63df6f4 (patch)
tree2416facd0a8e9318ba7ac7ff4e143268b8c45160
parent5ea51dfb6c6af8ec58f51f2af3a342fdb527ac6e (diff)
inotail.c: Minor cleanups
Make one more read(2) return value ssize_t and do not initialize n_files to 0
-rw-r--r--inotail.c6
1 files 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;