linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [udev] why can't we add two rules with the same 'NAME=' ?
@ 2003-12-20  2:19 Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2003-12-20  2:19 UTC (permalink / raw)
  To: linux-hotplug

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

Hi Greg,
why can't we add any valid config device to the list?
Since we support pattern matching it seems a bit confusing to the user.

Is it a leftover from the former permissions update code,
that is now in it's own function?

Do i miss something?

Kay

[-- Attachment #2: 04-add-any-valid-device.diff --]
[-- Type: text/plain, Size: 1187 bytes --]

diff -Nru a/namedev.c b/namedev.c
--- a/namedev.c	Sat Dec 20 03:11:25 2003
+++ b/namedev.c	Sat Dec 20 03:11:25 2003
@@ -103,31 +103,10 @@
 
 int add_config_dev(struct config_device *new_dev)
 {
-	struct list_head *tmp;
 	struct config_device *tmp_dev;
 
-	/* update the values if we already have the device */
-	list_for_each(tmp, &config_device_list) {
-		struct config_device *dev = list_entry(tmp, struct config_device, node);
-		if (strcmp_pattern(new_dev->name, dev->name))
-			continue;
-		if (strncmp(dev->bus, new_dev->bus, sizeof(dev->name)))
-			continue;
-		copy_var(dev, new_dev, type);
-		copy_string(dev, new_dev, bus);
-		copy_string(dev, new_dev, sysfs_file);
-		copy_string(dev, new_dev, sysfs_value);
-		copy_string(dev, new_dev, id);
-		copy_string(dev, new_dev, place);
-		copy_string(dev, new_dev, kernel_name);
-		copy_string(dev, new_dev, exec_program);
-		copy_string(dev, new_dev, symlink);
-		return 0;
-	}
-
-	/* not found, add new structure to the device list */
 	tmp_dev = malloc(sizeof(*tmp_dev));
-	if (!tmp_dev)
+	if (tmp_dev == NULL)
 		return -ENOMEM;
 	memcpy(tmp_dev, new_dev, sizeof(*tmp_dev));
 	list_add_tail(&tmp_dev->node, &config_device_list);

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

* Re: [udev] why can't we add two rules with the same 'NAME=' ?
@ 2003-12-22 20:36 Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2003-12-22 20:36 UTC (permalink / raw)
  To: linux-hotplug

On Sat, Dec 20, 2003 at 03:19:25AM +0100, Kay Sievers wrote:
> Hi Greg,
> why can't we add any valid config device to the list?
> Since we support pattern matching it seems a bit confusing to the user.
> 
> Is it a leftover from the former permissions update code,
> that is now in it's own function?

Yes, you are correct, it's a left over.  Thanks for the patch, applied.

greg k-h


-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id\x1278&alloc_id371&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] 2+ messages in thread

end of thread, other threads:[~2003-12-22 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-20  2:19 [udev] why can't we add two rules with the same 'NAME=' ? Kay Sievers
  -- strict thread matches above, loose matches on Subject: below --
2003-12-22 20:36 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).