summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++) {