summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-24 02:21:12 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-11-24 02:21:12 +0100
commitf408fd919a7af5fcd5dac5a505411842b3e8d853 (patch)
tree8818e54bf98da50bce447aa1ec47331815c2852c
parent45a9e9e27b9a497985ec68d6a21e2e4eea05922b (diff)
fix handling of swapping node name with symlink name
-rw-r--r--udev/udev-node.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/udev/udev-node.c b/udev/udev-node.c
index 1a189c5aae..100ca92903 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -371,18 +371,23 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev
struct udev_list_entry *list_entry_current;
int found;
+ /* check if old link name is now our node name */
+ if (strcmp(name, udev_device_get_devnode(dev)) == 0)
+ continue;
+
+ /* check if old link name still belongs to this device */
found = 0;
udev_list_entry_foreach(list_entry_current, udev_device_get_devlinks_list_entry(dev)) {
const char *name_current = udev_list_entry_get_name(list_entry_current);
- if (strcmp(name_current, name) == 0) {
+ if (strcmp(name, name_current) == 0) {
found = 1;
break;
}
}
if (found)
continue;
- /* link does no longer belong to this device */
+
info(udev, "update old symlink '%s' no longer belonging to '%s'\n", name, udev_device_get_devpath(dev));
name_index(udev, udev_device_get_devpath(dev), name, 0, test);
update_link(dev, name, test);