summaryrefslogtreecommitdiff
path: root/udev/udev-node.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-05 04:45:23 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-11-05 04:45:23 +0100
commit6e0cb78c9d59f976222ecd88c172b4cd9a5b7347 (patch)
tree36b7ce40be503f76dfa669d0d3090dab3e945e1c /udev/udev-node.c
parent7c4573e46d703ff65bcaeff8ad91250667f82fe2 (diff)
fix cleanup of possible left-over symlinks
Diffstat (limited to 'udev/udev-node.c')
-rw-r--r--udev/udev-node.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/udev/udev-node.c b/udev/udev-node.c
index ae343eb2da..1a189c5aae 100644
--- a/udev/udev-node.c
+++ b/udev/udev-node.c
@@ -367,13 +367,15 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev
/* update possible left-over symlinks */
udev_list_entry_foreach(list_entry, udev_device_get_devlinks_list_entry(dev_old)) {
+ const char *name = udev_list_entry_get_name(list_entry);
struct udev_list_entry *list_entry_current;
int found;
found = 0;
udev_list_entry_foreach(list_entry_current, udev_device_get_devlinks_list_entry(dev)) {
- if (strcmp(udev_list_entry_get_name(list_entry_current),
- udev_list_entry_get_name(list_entry)) == 0) {
+ const char *name_current = udev_list_entry_get_name(list_entry_current);
+
+ if (strcmp(name_current, name) == 0) {
found = 1;
break;
}
@@ -381,9 +383,9 @@ void udev_node_update_old_links(struct udev_device *dev, struct udev_device *dev
if (found)
continue;
/* link does no longer belong to this device */
- info(udev, "update old symlink '%s' no longer belonging to '%s'\n",
- udev_list_entry_get_name(list_entry), udev_device_get_devpath(dev));
- update_link(dev, udev_list_entry_get_name(list_entry), test);
+ 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);
}
/*
@@ -438,7 +440,7 @@ int udev_node_add(struct udev_device *dev, mode_t mode, uid_t uid, gid_t gid, in
}
}
- /* add node and to name index */
+ /* add node to name index */
name_index(udev, udev_device_get_devpath(dev), udev_device_get_devnode(dev), 1, test);
/* create/update symlinks, add symlinks to name index */