summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2012-11-20 18:07:57 +0100
committerKay Sievers <kay@vrfy.org>2012-11-20 18:07:57 +0100
commit5ae18ddc0d86673520c0dd6b59ccac8afc8aa605 (patch)
tree9464c563f0d3a234050858120348b876b2f52503 /src/libudev
parent3fd0c4c66df45ee457cfb5e4ca8e285914ebc32f (diff)
libudev: do not resolve $attr{device} symlinks
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-device.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/libudev/libudev-device.c b/src/libudev/libudev-device.c
index acf8e24d15..d246d012b2 100644
--- a/src/libudev/libudev-device.c
+++ b/src/libudev/libudev-device.c
@@ -1358,16 +1358,17 @@ _public_ const char *udev_device_get_sysattr_value(struct udev_device *udev_devi
goto out;
}
- /* resolve link to a device and return its syspath */
- util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
- dev = udev_device_new_from_syspath(udev_device->udev, path);
- if (dev != NULL) {
- list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
- udev_device_get_syspath(dev));
- val = udev_list_entry_get_value(list_entry);
- udev_device_unref(dev);
+ /* resolve custom link to a device and return its syspath */
+ if (!streq(sysattr, "device")) {
+ util_strscpyl(path, sizeof(path), udev_device->syspath, "/", sysattr, NULL);
+ dev = udev_device_new_from_syspath(udev_device->udev, path);
+ if (dev != NULL) {
+ list_entry = udev_list_entry_add(&udev_device->sysattr_value_list, sysattr,
+ udev_device_get_syspath(dev));
+ val = udev_list_entry_get_value(list_entry);
+ udev_device_unref(dev);
+ }
}
-
goto out;
}