From 9ba57f0c9dc4a2d4012c18039e9adc6839c6bea2 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Thu, 25 Mar 2021 17:22:42 +0100 Subject: [PATCH] iwatch: ignore EEXIST errors, we're already watching it In particular this can happen from cgroup.c when multiple services map to the same cgroup.events (due to being in the same cgroup) Signed-off-by: Joachim Wiberg --- src/iwatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/iwatch.c b/src/iwatch.c index afeb57d3..205bc8c1 100644 --- a/src/iwatch.c +++ b/src/iwatch.c @@ -94,7 +94,8 @@ int iwatch_add(struct iwatch *iw, char *file, uint32_t mask) wd = inotify_add_watch(iw->fd, path, IWATCH_MASK | mask); if (wd < 0) { - _pe("Failed adding watcher for %s", path); + if (errno != EEXIST) + _pe("Failed adding watcher for %s", path); free(path); return -1; }