chiark / gitweb /
[PATCH] udev - fix debug info for multiple rule file config
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>
Tue, 2 Mar 2004 06:28:51 +0000 (22:28 -0800)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:34:29 +0000 (21:34 -0700)
On Sat, Feb 28, 2004 at 09:56:32PM +0100, Kay Sievers wrote:
> Andrey pointed out that we don't print the right filename in the debug
> output. Here is a fix for that. It applies on top of Andrey's symlink
> patch, cause we are touching the same part of the code.

The copy/paste devil catched me :)
Here is a fixed one.

namedev.c
namedev.h
namedev_parse.c

index 505264554db3b041b18d31fddb2ef2cffdfd528c..2ebf276f6b9141e081ad849c7a160061174620aa 100644 (file)
--- a/namedev.c
+++ b/namedev.c
@@ -822,7 +822,7 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
                if (match_rule(dev, class_dev, udev, sysfs_device) == 0) {
                        if (dev->name[0] == '\0' && dev->symlink[0] == '\0') {
                                info("configured rule in '%s' at line %i applied, '%s' is ignored",
-                                    udev_rules_filename, dev->config_line, udev->kernel_name);
+                                    dev->config_file, dev->config_line, udev->kernel_name);
                                return -1;
                        }
 
@@ -830,7 +830,7 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
                                char temp[NAME_MAX];
 
                                info("configured rule in '%s' at line %i applied, added symlink '%s'",
-                                    udev_rules_filename, dev->config_line, dev->symlink);
+                                    dev->config_file, dev->config_line, dev->symlink);
                                /* do not clobber dev */
                                strfieldcpy(temp, dev->symlink);
                                apply_format(udev, temp, sizeof(temp),
@@ -841,7 +841,7 @@ int namedev_name_device(struct sysfs_class_device *class_dev, struct udevice *ud
 
                        if (dev->name[0] != '\0') {
                                info("configured rule in '%s' at line %i applied, '%s' becomes '%s'",
-                                    udev_rules_filename, dev->config_line, udev->kernel_name, dev->name);
+                                    dev->config_file, dev->config_line, udev->kernel_name, dev->name);
                                strfieldcpy(udev->name, dev->name);
                                goto found;
                        }
index ffdde83ca4843058d08f3f7b172b360a4426944e..7f875ed6030847b1cda40d81c195c1cf5a5a9403 100644 (file)
--- a/namedev.h
+++ b/namedev.h
@@ -72,6 +72,7 @@ struct config_device {
        char symlink[NAME_SIZE];
        struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
        int partitions;
+       char config_file[NAME_SIZE];
        int config_line;
 };
 
index d300b0907d82f1aff214abab492e6f7f2ea258da..19acd96ef056cb6b7ecf9b9d36feefbdbfeb52e9 100644 (file)
@@ -260,6 +260,7 @@ static int namedev_parse_rules(char *filename)
                }
 
                dev.config_line = lineno;
+               strfieldcpy(dev.config_file, filename);
                retval = add_config_dev(&dev);
                if (retval) {
                        dbg("add_config_dev returned with error %d", retval);