summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2010-12-14 21:26:12 +0100
committerKay Sievers <kay.sievers@vrfy.org>2010-12-15 08:58:45 +0100
commit93a724d3f8afc4b6fe5c7c9642c79df724324ed3 (patch)
tree1372f03948030e1fdcd68cd004729a98e39ac885 /libudev
parentab17a7ef55b2c3278839302cf3ba5d214d2b2b7d (diff)
libudev: fix renamed device nodes detection logic
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-device-private.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libudev/libudev-device-private.c b/libudev/libudev-device-private.c
index d1df45ee74..36824a7478 100644
--- a/libudev/libudev-device-private.c
+++ b/libudev/libudev-device-private.c
@@ -78,6 +78,7 @@ int udev_device_tag_index(struct udev_device *dev, struct udev_device *dev_old,
static bool device_has_info(struct udev_device *udev_device)
{
+ struct udev *udev = udev_device_get_udev(udev_device);
struct udev_list_entry *list_entry;
if (udev_device_get_devlinks_list_entry(udev_device) != NULL)
@@ -89,9 +90,12 @@ static bool device_has_info(struct udev_device *udev_device)
return true;
if (udev_device_get_tags_list_entry(udev_device) != NULL)
return true;
- if (udev_device_get_knodename(udev_device) != NULL)
- if (strcmp(udev_device_get_devnode(udev_device), udev_device_get_knodename(udev_device)) != 0)
+ if (udev_device_get_devnode(udev_device) != NULL && udev_device_get_knodename(udev_device) != NULL) {
+ size_t devlen = strlen(udev_get_dev_path(udev))+1;
+
+ if (strcmp(&udev_device_get_devnode(udev_device)[devlen], udev_device_get_knodename(udev_device)) != 0)
return true;
+ }
if (udev_device_get_watch_handle(udev_device) >= 0)
return true;
return false;