From 7d0fd8ba45e7f3193220302e131c01963a9d8096 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 3 Mar 2007 09:43:55 +0100 Subject: inotail.c: Cleanup before release --- inotail.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/inotail.c b/inotail.c index 6999a99..6e1c465 100644 --- a/inotail.c +++ b/inotail.c @@ -55,13 +55,13 @@ static int n_ignored = 0; /* Command line options */ static const struct option long_opts[] = { - {"bytes", required_argument, NULL, 'c'}, - {"follow", optional_argument, NULL, 'f'}, - {"lines", required_argument, NULL, 'n'}, - {"verbose", no_argument, NULL, 'v'}, - {"help", no_argument, NULL, 'h'}, - {"version", no_argument, NULL, 'V'}, - {NULL, 0, NULL, 0} + { "bytes", required_argument, NULL, 'c' }, + { "follow", optional_argument, NULL, 'f' }, + { "lines", required_argument, NULL, 'n' }, + { "verbose", no_argument, NULL, 'v' }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 } }; static void usage(const int status) @@ -291,13 +291,7 @@ static int handle_inotify_event(struct inotify_event *inev, struct file_struct * ssize_t rc; char fbuf[BUFFER_SIZE]; struct stat finfo; -#if 0 - f->fd = open(f->name, O_RDONLY); - if (f->fd < 0) { - fprintf(stderr, "Error: Could not open file '%s' (%s)\n", f->name, strerror(errno)); - goto ignore; - } -#endif + if (verbose) write_header(f->name); @@ -312,9 +306,7 @@ static int handle_inotify_event(struct inotify_event *inev, struct file_struct * } f->st_size = finfo.st_size; -#if 0 - close(f->fd); -#endif + return ret; } else if (inev->mask & IN_DELETE_SELF) { fprintf(stderr, "File '%s' deleted.\n", f->name); -- cgit v1.2.3-54-g00ecf