diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2007-01-20 17:12:51 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@xenon.tklauser.home> | 2007-01-20 17:12:51 +0100 |
commit | e7d1bd52c77ed84676514dc09ac7087262d53e9b (patch) | |
tree | 81e2ace8cfea843375757db8c6b889f59e7361e4 | |
parent | 1e3ccf4b6a5ffee1f57dd50c23ae20499ed74910 (diff) |
inotail.c: Better handling of errors on inotify_init()
-rw-r--r-- | inotail.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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++) { |