All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: [udev] why can't we add two rules with the same 'NAME=' ?
Date: Sat, 20 Dec 2003 02:19:25 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107188683630561@msgid-missing> (raw)

[-- 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);

             reply	other threads:[~2003-12-20  2:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-20  2:19 Kay Sievers [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-12-22 20:36 [udev] why can't we add two rules with the same 'NAME=' ? Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-107188683630561@msgid-missing \
    --to=kay.sievers@vrfy.org \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.