summaryrefslogtreecommitdiff
path: root/src/udev/udev-event.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-04-16 17:21:22 +0200
committerKay Sievers <kay@vrfy.org>2012-04-16 19:20:57 +0200
commit6ada823a9a0979ea145fd70add1007c21caa45c0 (patch)
tree3eff7319e77b9cdffda502cb373a1eae6c6488bb /src/udev/udev-event.c
parent8fef0ff25c9fd7e5bb99d66f43c6357e4996a3cc (diff)
udev: remove configuration options for /dev, /sys, /run directories
Diffstat (limited to 'src/udev/udev-event.c')
-rw-r--r--src/udev/udev-event.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index eab1bae27f..d330062ebf 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -318,46 +318,38 @@ subst:
if (dev_parent == NULL)
break;
devnode = udev_device_get_devnode(dev_parent);
- if (devnode != NULL) {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
-
- l = util_strpcpy(&s, l, &devnode[devlen]);
- }
+ if (devnode != NULL)
+ l = util_strpcpy(&s, l, devnode + strlen(TEST_PREFIX "/dev/"));
break;
}
case SUBST_DEVNODE:
if (udev_device_get_devnode(dev) != NULL)
l = util_strpcpy(&s, l, udev_device_get_devnode(dev));
break;
- case SUBST_NAME: {
- if (event->name != NULL) {
+ case SUBST_NAME:
+ if (event->name != NULL)
l = util_strpcpy(&s, l, event->name);
- } else if (udev_device_get_devnode(dev) != NULL) {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
-
- l = util_strpcpy(&s, l, &udev_device_get_devnode(dev)[devlen]);
- } else {
+ else if (udev_device_get_devnode(dev) != NULL)
+ l = util_strpcpy(&s, l, udev_device_get_devnode(dev) + strlen(TEST_PREFIX "/dev/"));
+ else
l = util_strpcpy(&s, l, udev_device_get_sysname(dev));
- }
break;
- }
case SUBST_LINKS: {
- size_t devlen = strlen(udev_get_dev_path(event->udev))+1;
struct udev_list_entry *list_entry;
list_entry = udev_device_get_devlinks_list_entry(dev);
if (list_entry == NULL)
break;
- l = util_strpcpy(&s, l, &udev_list_entry_get_name(list_entry)[devlen]);
+ l = util_strpcpy(&s, l, udev_list_entry_get_name(list_entry) + strlen(TEST_PREFIX "/dev/"));
udev_list_entry_foreach(list_entry, udev_list_entry_get_next(list_entry))
- l = util_strpcpyl(&s, l, " ", &udev_list_entry_get_name(list_entry)[devlen], NULL);
+ l = util_strpcpyl(&s, l, " ", udev_list_entry_get_name(list_entry) + strlen(TEST_PREFIX "/dev/"), NULL);
break;
}
case SUBST_ROOT:
- l = util_strpcpy(&s, l, udev_get_dev_path(event->udev));
+ l = util_strpcpy(&s, l, TEST_PREFIX "/dev");
break;
case SUBST_SYS:
- l = util_strpcpy(&s, l, udev_get_sys_path(event->udev));
+ l = util_strpcpy(&s, l, TEST_PREFIX "/sys");
break;
case SUBST_ENV:
if (attr == NULL) {