From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kay Sievers Date: Thu, 11 Mar 2004 00:36:45 +0000 Subject: [PATCH] "symlink only" test Message-Id: <20040311003645.GC31657@vrfy.org> MIME-Version: 1 Content-Type: multipart/mixed; boundary="adJ1OR3c6QgCpb/j" List-Id: To: linux-hotplug@vger.kernel.org --adJ1OR3c6QgCpb/j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --adJ1OR3c6QgCpb/j Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="03-symlink-only-cleanup.patch" ===== 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 => <