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 <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-03-25 17:22:42 +01:00
parent 9c2f0b2dc8
commit 9ba57f0c9d
+2 -1
View File
@@ -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;
}