diff options
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r-- | src/udev/udev-watch.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c index 6ba8674d77..b6a0d3e93d 100644 --- a/src/udev/udev-watch.c +++ b/src/udev/udev-watch.c @@ -50,13 +50,13 @@ void udev_watch_restore(struct udev *udev) { if (inotify_fd < 0) return; - if (rename("/run/udev/watch", "/run/udev/watch.old") == 0) { + if (rename(UDEV_ROOT_RUN "/udev/watch", UDEV_ROOT_RUN "/udev/watch.old") == 0) { DIR *dir; struct dirent *ent; - dir = opendir("/run/udev/watch.old"); + dir = opendir(UDEV_ROOT_RUN "/udev/watch.old"); if (dir == NULL) { - log_error_errno(errno, "unable to open old watches dir /run/udev/watch.old; old watches will not be restored: %m"); + log_error_errno(errno, "unable to open old watches dir " UDEV_ROOT_RUN "/udev/watch.old; old watches will not be restored: %m"); return; } @@ -85,10 +85,10 @@ unlink: } closedir(dir); - rmdir("/run/udev/watch.old"); + rmdir(UDEV_ROOT_RUN "/udev/watch.old"); } else if (errno != ENOENT) { - log_error_errno(errno, "unable to move watches dir /run/udev/watch; old watches will not be restored: %m"); + log_error_errno(errno, "unable to move watches dir " UDEV_ROOT_RUN "/udev/watch; old watches will not be restored: %m"); } } @@ -108,7 +108,7 @@ void udev_watch_begin(struct udev *udev, struct udev_device *dev) { return; } - snprintf(filename, sizeof(filename), "/run/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); mkdir_parents(filename, 0755); unlink(filename); r = symlink(udev_device_get_id_filename(dev), filename); @@ -132,7 +132,7 @@ void udev_watch_end(struct udev *udev, struct udev_device *dev) { log_debug("removing watch on '%s'", udev_device_get_devnode(dev)); inotify_rm_watch(inotify_fd, wd); - snprintf(filename, sizeof(filename), "/run/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); unlink(filename); udev_device_set_watch_handle(dev, -1); @@ -146,7 +146,7 @@ struct udev_device *udev_watch_lookup(struct udev *udev, int wd) { if (inotify_fd < 0 || wd < 0) return NULL; - snprintf(filename, sizeof(filename), "/run/udev/watch/%d", wd); + snprintf(filename, sizeof(filename), UDEV_ROOT_RUN "/udev/watch/%d", wd); len = readlink(filename, device, sizeof(device)); if (len <= 0 || (size_t)len == sizeof(device)) return NULL; |