[PATH_FAILED] = UNIT_FAILED
};
+static void path_unwatch_one(Path *p, PathSpec *s) {
+
+ if (s->inotify_fd < 0)
+ return;
+
+ unit_unwatch_fd(UNIT(p), &s->watch);
+
+ close_nointr_nofail(s->inotify_fd);
+ s->inotify_fd = -1;
+}
+
static void path_done(Unit *u) {
Path *p = PATH(u);
PathSpec *s;
assert(p);
while ((s = p->specs)) {
+ path_unwatch_one(p, s);
LIST_REMOVE(PathSpec, spec, p->specs, s);
+ free(s->path);
free(s);
}
}
s->path);
}
-static void path_unwatch_one(Path *p, PathSpec *s) {
-
- if (s->inotify_fd < 0)
- return;
-
- unit_unwatch_fd(UNIT(p), &s->watch);
-
- close_nointr_nofail(s->inotify_fd);
- s->inotify_fd = -1;
-}
-
static int path_watch_one(Path *p, PathSpec *s) {
static const int flags_table[_PATH_TYPE_MAX] = {
[PATH_EXISTS] = IN_DELETE_SELF|IN_MOVE_SELF|IN_ATTRIB,