chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
45a9e9e
)
fix handling of swapping node name with symlink name
author
Kay Sievers
<kay.sievers@vrfy.org>
Mon, 24 Nov 2008 01:21:12 +0000
(
02:21
+0100)
committer
Kay Sievers
<kay.sievers@vrfy.org>
Mon, 24 Nov 2008 01:21:12 +0000
(
02:21
+0100)
udev/udev-node.c
patch
|
blob
|
history
diff --git
a/udev/udev-node.c
b/udev/udev-node.c
index 1a189c5aae7c078371f9d9c9be429f45085d84d8..100ca92903ef2baf41ff36b6a5f2326176221325 100644
(file)
--- 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;
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);
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;
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);
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);