* [PATCH] "symlink only" test
@ 2004-03-11 0:36 Kay Sievers
2004-03-11 1:42 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Kay Sievers @ 2004-03-11 0:36 UTC (permalink / raw)
To: linux-hotplug
[-- Attachment #1: Type: text/plain, Size: 128 bytes --]
Here is a test for the "symlink only" rule.
Any reason to do the apply_format() inside the loop?
I've changed it.
thanks,
Kay
[-- Attachment #2: 03-symlink-only-cleanup.patch --]
[-- Type: text/plain, Size: 1683 bytes --]
===== namedev.c 1.129 vs edited =====
--- 1.129/namedev.c Thu Mar 11 01:15:25 2004
+++ edited/namedev.c Thu Mar 11 01:23:01 2004
@@ -815,16 +815,11 @@
}
if (dev->symlink[0] != '\0') {
- char temp[NAME_MAX];
-
info("configured rule in '%s' at line %i applied, added symlink '%s'",
dev->config_file, dev->config_line, dev->symlink);
- /* do not clobber dev */
- strfieldcpy(temp, dev->symlink);
- apply_format(udev, temp, sizeof(temp),
- class_dev, sysfs_device);
- strfieldcat(udev->symlink, temp);
- strfieldcat(udev->symlink, " ");
+ if (udev->symlink[0] != '\0')
+ strfieldcat(udev->symlink, " ");
+ strfieldcat(udev->symlink, dev->symlink);
}
if (dev->name[0] != '\0') {
@@ -841,8 +836,8 @@
goto done;
found:
- apply_format(udev, udev->name, sizeof(udev->name),
- class_dev, sysfs_device);
+ apply_format(udev, udev->name, sizeof(udev->name), class_dev, sysfs_device);
+ apply_format(udev, udev->symlink, sizeof(udev->symlink), class_dev, sysfs_device);
udev->partitions = dev->partitions;
done:
===== test/udev-test.pl 1.44 vs edited =====
--- 1.44/test/udev-test.pl Thu Mar 11 01:15:25 2004
+++ edited/test/udev-test.pl Thu Mar 11 01:27:54 2004
@@ -513,6 +513,17 @@
BUS="scsi", SYSFS{whitespace_test}="WHITE SPACE ", NAME="matched-with-space"
EOF
},
+ {
+ desc => "SYMLINK only rule",
+ subsys => "block",
+ devpath => "block/sda",
+ expected => "symlink-only2",
+ conf => <<EOF
+BUS="scsi", KERNEL="sda", SYMLINK="symlink-only1"
+BUS="scsi", KERNEL="sda", SYMLINK="symlink-only2"
+BUS="scsi", KERNEL="sda", NAME="link", SYMLINK="symlink0"
+EOF
+ },
);
# set env
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] "symlink only" test
2004-03-11 0:36 [PATCH] "symlink only" test Kay Sievers
@ 2004-03-11 1:42 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2004-03-11 1:42 UTC (permalink / raw)
To: linux-hotplug
On Thu, Mar 11, 2004 at 01:36:45AM +0100, Kay Sievers wrote:
> Here is a test for the "symlink only" rule.
>
> Any reason to do the apply_format() inside the loop?
> I've changed it.
Nice cleanup. Applied, 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_id\x1470&alloc_id638&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-03-11 1:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-11 0:36 [PATCH] "symlink only" test Kay Sievers
2004-03-11 1:42 ` 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).