+ inotify_add_watch(s->inotify_fd, path, IN_MOVE_SELF);
+ /* Error is ignored, the worst can happen is
+ we get spurious events. */
+
+ oldslash[oldslash == path] = tmp2;
+ }
+ }
+
+ if (slash) {
+ slash[slash == path] = tmp;
+ oldslash = slash;
+ } else {
+ /* whole path has been iterated over */
+ s->primary_wd = r;
+ break;
+ }
+ }
+
+ assert(errno == EACCES || errno == ENOENT || streq(path, s->path));
+
+ if (!exists) {
+ log_error("Failed to add watch on any of the components of %s: %m",
+ s->path);
+ r = -errno; /* either EACCESS or ENOENT */
+ goto fail;
+ }