summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-03-03 09:43:55 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-03-03 09:43:55 +0100
commit7d0fd8ba45e7f3193220302e131c01963a9d8096 (patch)
tree190d61da491fabfd65630e431ec8f346ec429d99
parent2d435d7bb7af2b80d36859e05372f7edf8739f05 (diff)
inotail.c: Cleanup before release
-rw-r--r--inotail.c26
1 files 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);