summaryrefslogtreecommitdiff
path: root/namedev.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-03-24 17:34:00 -0800
committerGreg KH <gregkh@suse.de>2005-04-26 21:35:10 -0700
commitddd5b5dc4890d40b7ed412e9de52b33e62447f78 (patch)
treeecf44703068a29173a69b13e58d7b0fbad52833b /namedev.c
parent2a94c8777eacff16821a06368092852f7b42882f (diff)
[PATCH] correct apply_format() for symlink only rules
Patch from Andrey, which restores the ability to use RESULT values in a "symlink only" rule. We need to call apply_format() directly after the matching rule, otherwise the RESULT value may be lost.
Diffstat (limited to 'namedev.c')
-rw-r--r--namedev.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/namedev.c b/namedev.c
index 6606ce8f79..98529cb840 100644
--- a/namedev.c
+++ b/namedev.c
@@ -816,11 +816,15 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
}
if (dev->symlink[0] != '\0') {
+ char temp[NAMESIZE];
+
info("configured rule in '%s' at line %i applied, added symlink '%s'",
dev->config_file, dev->config_line, dev->symlink);
+ strfieldcpy(temp, dev->symlink);
+ apply_format(udev, temp, sizeof(temp), class_dev, sysfs_device);
if (udev->symlink[0] != '\0')
strfieldcat(udev->symlink, " ");
- strfieldcat(udev->symlink, dev->symlink);
+ strfieldcat(udev->symlink, temp);
}
if (dev->name[0] != '\0') {
@@ -838,7 +842,6 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
found:
apply_format(udev, udev->name, sizeof(udev->name), class_dev, sysfs_device);
- apply_format(udev, udev->symlink, sizeof(udev->symlink), class_dev, sysfs_device);
udev->partitions = dev->partitions;
strfieldcpy(udev->config_file, dev->config_file);
udev->config_line = dev->config_line;