summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2010-03-24 23:18:35 -0700
committerPeter Hutterer <peter.hutterer@who-t.net>2010-03-26 15:30:57 +1000
commitaa91508356f243edc3b11795b1481edcfe0d39c2 (patch)
tree5e641ae075f0d7094cc9e021b1d462578d1bb039 /config
parentd00c3298a698ddddc8967215cef7dd941fa15804 (diff)
config/udev: Prefer product name from attribute rather than uevent
The input device product name for evdev devices in the kernel uevent has embedded quotes that aren't expected here. Use the sysfs name attribute instead, which does not suffer this problem. The uevent name will be used as a fallback if no name attribute is found. Signed-off-by: Dan Nicholson <dbn.lists@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'config')
-rw-r--r--config/udev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/config/udev.c b/config/udev.c
index 69257e935..452fb5a8d 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -73,8 +73,11 @@ device_added(struct udev_device *udev_device)
goto unwind;
parent = udev_device_get_parent(udev_device);
- if (parent)
- name = udev_device_get_property_value(parent, "NAME");
+ if (parent) {
+ name = udev_device_get_sysattr_value(parent, "name");
+ if (!name)
+ name = udev_device_get_property_value(parent, "NAME");
+ }
if (!name)
name = "(unnamed)";
else