summaryrefslogtreecommitdiff
path: root/src/udev/udev-watch.c
diff options
context:
space:
mode:
authorDavid Cortarello <dcortarello@gmail.com>2015-03-25 01:48:36 -0300
committerAnthony G. Basile <blueness@gentoo.org>2015-03-27 11:34:13 -0400
commit6a398265f3bd30a252cba2b1ada04ff1c617cf96 (patch)
tree2a0761e4c4b46b8bb433e24032a4353cab3bed58 /src/udev/udev-watch.c
parent3cda11ed7c226adc9f4818cecfb21974239d632b (diff)
Remove hardcoded path /run and configure using --with-rootrundir=
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/udev/udev-watch.c')
-rw-r--r--src/udev/udev-watch.c16
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;