From e7d1bd52c77ed84676514dc09ac7087262d53e9b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Sat, 20 Jan 2007 17:12:51 +0100 Subject: inotail.c: Better handling of errors on inotify_init() --- inotail.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'inotail.c') 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++) { -- cgit v1.2.3-54-g00ecf