diff options
author | Kay Sievers <kay@vrfy.org> | 2012-11-20 18:07:57 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2012-11-20 18:07:57 +0100 |
commit | 5ae18ddc0d86673520c0dd6b59ccac8afc8aa605 (patch) | |
tree | 9464c563f0d3a234050858120348b876b2f52503 | |
parent | 3fd0c4c66df45ee457cfb5e4ca8e285914ebc32f (diff) |
libudev: do not resolve $attr{device} symlinks
-rw-r--r-- | src/libudev/libudev-device.c | 19 |
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; } |