summaryrefslogtreecommitdiff
path: root/udev_node.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-09-20 19:38:58 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-09-20 19:38:58 +0200
commitb2d1ae727e78ac3e22caa11798360d87775095ff (patch)
treef38c9e559b1b77afe0a86c635a00643ebffab3dd /udev_node.c
parent18770246edda383eef523a7e3aedd08ebbbde5cf (diff)
prevent wrong symlink creation if database disagress with current rules
Diffstat (limited to 'udev_node.c')
-rw-r--r--udev_node.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/udev_node.c b/udev_node.c
index 556a442a33..c620e4aa0b 100644
--- a/udev_node.c
+++ b/udev_node.c
@@ -218,14 +218,16 @@ static int update_link(struct udevice *udev, const char *name)
if (strcmp(udev->dev->devpath, device->name) == 0) {
info("compare (our own) priority of '%s' %i >= %i",
udev->dev->devpath, udev->link_priority, priority);
- if (target[0] == '\0' || udev->link_priority >= priority) {
+ if (strcmp(udev->name, name) == 0) {
+ info("'%s' is our device node, database inconsistent, skip link update", udev->name);
+ } else if (target[0] == '\0' || udev->link_priority >= priority) {
priority = udev->link_priority;
strlcpy(target, udev->name, sizeof(target));
}
continue;
}
- /* or something else, then read priority from database */
+ /* another device, read priority from database */
udev_db = udev_device_init(NULL);
if (udev_db == NULL)
continue;