udev 021 patches 1/2
strip_trailing_blanks: makes comparisons on sysfs fields not sensitive to trailing blanks (tested, it works for me).
Signature · 2 lines
ciao, | Marco | [4888 seIurgyHK/uw2]
namedev.c +13 -0
@@ -520,6 +520,17 @@ attr_found:return tmpattr; } +static void strip_trailing_blanks (char *s) +{ +char *p; + +for (p = s +strlen (s) -1 ; p > s; p--) { +if (!isspace (*p)) +break ; + *p ='\0' ; + } +} +static int compare_sysfs_attribute (struct sysfs_class_device *class_dev,struct sysfs_device *sysfs_device,struct sysfs_pair *pair) {struct sysfs_attribute *tmpattr;
@@ -531,6 +542,8 @@ static int compare_sysfs_attribute(strucif (tmpattr ==NULL )return -ENODEV ; +strip_trailing_blanks (tmpattr->value); +strip_trailing_blanks (pair->value);dbg ("compare attribute '%s' value '%s' with '%s'" , pair->file, tmpattr->value, pair->value);if (strcmp_pattern (pair->value, tmpattr->value) !=0 )
Quoted 2 lines · Marco d'Itri
strip_trailing_blanks: makes comparisons on sysfs fields not sensitive to trailing blanks (tested, it works for me).
I've taken Kay's patch for this instead, as it will work for both situations (wanting to test for trailing spaces, and not wanting to.)
thanks,
greg k-h
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id70&alloc_id638&op=click
_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel