From 4c080dd248ac12658ffd6deeb87b5c633f50de04 Mon Sep 17 00:00:00 2001 From: Henrik Hautakoski Date: Mon, 20 Dec 2010 20:08:09 +0100 Subject: [PATCH] inotify.c: log errors from inotify --- src/inotify.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/inotify.c b/src/inotify.c index 659ad8d..dc21d60 100644 --- a/src/inotify.c +++ b/src/inotify.c @@ -56,6 +56,7 @@ static int addwatch(const char *path, const char *name, unsigned recursive) { wd = inotify_add_watch(fd, npath, WATCH_MASK); if (wd < 0) { + logerrno(LOG_CRIT, "inotify_add_watch", errno); free(npath); return -1; } @@ -115,7 +116,11 @@ static int rmwatch(const char *path, const char *name) { logmsg(LOG_DEBUG, "remove watch: %i %s", node->key, (char*) node->data); - return inotify_rm_watch(fd, node->key); + if (inotify_rm_watch(fd, node->key) < 0) { + logerrno(LOG_CRIT, "intotify_rm_watch", errno); + return -1; + } + return 0; } static void proc_event(inoev *iev) {