linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] udev add wild card compare for ID
@ 2004-02-12  0:33 Patrick Mansfield
  2004-02-12  1:26 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Patrick Mansfield @ 2004-02-12  0:33 UTC (permalink / raw)
  To: linux-hotplug

Patch on top of previous patch.

Allow wild card comparison of the ID.

Using strcmp_pattern here also means we on longer match partial values,
for example, a scsi rule like this won't match anymore:

	BUS="scsi", ID=":0", NAME="sdfoo-short-bus_id-1"

But this now works:

	BUS="scsi", ID="*:0", NAME="sdfoo-bus_id-wild-card-1"

=== namedev.c 1.101 vs edited ==--- 1.101/namedev.c	Wed Feb 11 16:20:32 2004
+++ edited/namedev.c	Wed Feb 11 16:24:00 2004
@@ -477,8 +477,9 @@
 
 	strfieldcpy(path, sysfs_device->path);
 	temp = strrchr(path, '/');
+	temp++;
 	dbg("search '%s' in '%s', path='%s'", dev->id, temp, path);
-	if (strstr(temp, dev->id) = NULL)
+	if (strcmp_pattern(dev->id, temp) != 0)
 		return -ENODEV;
 	else
 		return 0;


-------------------------------------------------------
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] 2+ messages in thread

* Re: [PATCH] udev add wild card compare for ID
  2004-02-12  0:33 [PATCH] udev add wild card compare for ID Patrick Mansfield
@ 2004-02-12  1:26 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-02-12  1:26 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Feb 11, 2004 at 04:33:23PM -0800, Patrick Mansfield wrote:
> Patch on top of previous patch.
> 
> Allow wild card comparison of the ID.
> 
> Using strcmp_pattern here also means we on longer match partial values,
> for example, a scsi rule like this won't match anymore:
> 
> 	BUS="scsi", ID=":0", NAME="sdfoo-short-bus_id-1"
> 
> But this now works:
> 
> 	BUS="scsi", ID="*:0", NAME="sdfoo-bus_id-wild-card-1"

Nice, I've applied this.

Care to write up a rule for udev-test.pl so we don't accidentially break
this feature some time in the future?

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] 2+ messages in thread

end of thread, other threads:[~2004-02-12  1:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-02-12  0:33 [PATCH] udev add wild card compare for ID Patrick Mansfield
2004-02-12  1:26 ` 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).