All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kay Sievers <kay.sievers@vrfy.org>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH] "symlink only" test
Date: Thu, 11 Mar 2004 00:36:45 +0000	[thread overview]
Message-ID: <20040311003645.GC31657@vrfy.org> (raw)

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

             reply	other threads:[~2004-03-11  0:36 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-11  0:36 Kay Sievers [this message]
2004-03-11  1:42 ` [PATCH] "symlink only" test 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=20040311003645.GC31657@vrfy.org \
    --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.