linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udev - fix debug info for multiple rule file config
@ 2004-02-28 20:56 Kay Sievers
  2004-02-28 21:41 ` Kay Sievers
  2004-03-01 22:28 ` Greg KH
  0 siblings, 2 replies; 3+ messages in thread
From: Kay Sievers @ 2004-02-28 20:56 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 210 bytes --]

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.

thanks,
Kay

[-- Attachment #2: 03-rules-debug.patch --]
[-- Type: text/plain, Size: 1843 bytes --]

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Sat Feb 28 21:51:04 2004
+++ b/namedev.c	Sat Feb 28 21:51:04 2004
@@ -822,7 +822,7 @@
 		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, dev->name);
 				return -1;
 			}
 
@@ -830,7 +830,7 @@
 				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 @@
 
 			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;
 			}
diff -Nru a/namedev.h b/namedev.h
--- a/namedev.h	Sat Feb 28 21:51:04 2004
+++ b/namedev.h	Sat Feb 28 21:51:04 2004
@@ -72,6 +72,7 @@
 	char symlink[NAME_SIZE];
 	struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
 	int partitions;
+	char config_file[NAME_SIZE];
 	int config_line;
 };
 
diff -Nru a/namedev_parse.c b/namedev_parse.c
--- a/namedev_parse.c	Sat Feb 28 21:51:04 2004
+++ b/namedev_parse.c	Sat Feb 28 21:51:04 2004
@@ -260,6 +260,7 @@
 		}
 
 		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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] udev - fix debug info for multiple rule file config
  2004-02-28 20:56 [PATCH] udev - fix debug info for multiple rule file config Kay Sievers
@ 2004-02-28 21:41 ` Kay Sievers
  2004-03-01 22:28 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Kay Sievers @ 2004-02-28 21:41 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 326 bytes --]

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.

Kay

[-- Attachment #2: 03-rules-debug.patch --]
[-- Type: text/plain, Size: 1832 bytes --]

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Sat Feb 28 21:51:04 2004
+++ b/namedev.c	Sat Feb 28 21:51:04 2004
@@ -822,7 +822,7 @@
 		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 @@
 				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 @@
 
 			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;
 			}
diff -Nru a/namedev.h b/namedev.h
--- a/namedev.h	Sat Feb 28 21:51:04 2004
+++ b/namedev.h	Sat Feb 28 21:51:04 2004
@@ -72,6 +72,7 @@
 	char symlink[NAME_SIZE];
 	struct sysfs_pair sysfs_pair[MAX_SYSFS_PAIRS];
 	int partitions;
+	char config_file[NAME_SIZE];
 	int config_line;
 };
 
diff -Nru a/namedev_parse.c b/namedev_parse.c
--- a/namedev_parse.c	Sat Feb 28 21:51:04 2004
+++ b/namedev_parse.c	Sat Feb 28 21:51:04 2004
@@ -260,6 +260,7 @@
 		}
 
 		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);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] udev - fix debug info for multiple rule file config
  2004-02-28 20:56 [PATCH] udev - fix debug info for multiple rule file config Kay Sievers
  2004-02-28 21:41 ` Kay Sievers
@ 2004-03-01 22:28 ` Greg KH
  1 sibling, 0 replies; 3+ messages in thread
From: Greg KH @ 2004-03-01 22:28 UTC (permalink / raw)
  To: linux-hotplug

On Sat, Feb 28, 2004 at 10:41:11PM +0100, Kay Sievers wrote:
> 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.

Applied, thanks.

greg k-h


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id\x1356&alloc_id438&op=click
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-03-01 22:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-28 20:56 [PATCH] udev - fix debug info for multiple rule file config Kay Sievers
2004-02-28 21:41 ` Kay Sievers
2004-03-01 22:28 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).