summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2007-01-20 17:12:51 +0100
committerTobias Klauser <tklauser@xenon.tklauser.home>2007-01-20 17:12:51 +0100
commite7d1bd52c77ed84676514dc09ac7087262d53e9b (patch)
tree81e2ace8cfea843375757db8c6b889f59e7361e4
parent1e3ccf4b6a5ffee1f57dd50c23ae20499ed74910 (diff)
inotail.c: Better handling of errors on inotify_init()
-rw-r--r--inotail.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/inotail.c b/inotail.c
index dbb95eb..724c471 100644
--- a/inotail.c
+++ b/inotail.c
@@ -342,9 +342,12 @@ static int watch_files(struct file_struct *files, int n_files)
char buf[n_files * INOTIFY_BUFLEN];
ifd = inotify_init();
- if (ifd < 0) {
+ if (errno == ENOSYS) {
fprintf(stderr, "Error: Inotify is not supported by the kernel you're currently running.\n");
exit(EXIT_FAILURE);
+ } else if (ifd < 0) {
+ fprintf(stderr, "Error: Could not initialize Inotify (%s)\n", strerror(errno));
+ exit(EXIT_FAILURE);
}
for (i = 0; i < n_files; i++) {