summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-10-29 22:22:12 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-10-29 22:22:12 +0100
commitaeb53ca3d60057dfbb948b222046dcecfcc11ed9 (patch)
tree0fb3a1251bc45725ee41b1f3927b3d9f66f5e189
parent0bc74ea79f68a89c5ec4bf5676dede97626ceade (diff)
ATTR{}== always fails if the attribute does not exist
-rw-r--r--TODO1
-rw-r--r--udev/udev-rules.c7
-rw-r--r--udev/udev.xml6
3 files changed, 6 insertions, 8 deletions
diff --git a/TODO b/TODO
index 054d52f984..a8d3fc0515 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,4 @@
+
o add DVB variables to kernel (patch sent), and drop shell script rule
o DEVTYPE for disks is set by the kernel, they will be removed from
the default rules
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 665ad71e80..f6cc45ba75 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -1808,11 +1808,10 @@ static int match_attr(struct udev_rules *rules, struct udev_device *dev, struct
const char *val;
val = udev_device_get_sysattr_value(dev, key_name);
- if (val != NULL)
- util_strlcpy(value, val, sizeof(value));
+ if (val == NULL)
+ return -1;
+ util_strlcpy(value, val, sizeof(value));
}
- if (value[0] == '\0')
- return -1;
/* strip trailing whitespace of value, if not asked to match for it */
len = strlen(key_value);
diff --git a/udev/udev.xml b/udev/udev.xml
index c4e99f1ad5..ccc1f45e4c 100644
--- a/udev/udev.xml
+++ b/udev/udev.xml
@@ -186,8 +186,7 @@
<listitem>
<para>Match sysfs attribute values of the event device. Trailing
whitespace in the attribute values is ignored, if the specified match
- value does not contain trailing whitespace itself. Depending on the type
- of operator, this key is also used to set the value of a sysfs attribute.
+ value does not contain trailing whitespace itself.
</para>
</listitem>
</varlistentry>
@@ -318,8 +317,7 @@
<term><option>ATTR{<replaceable>key</replaceable>}</option></term>
<listitem>
<para>The value that should be written to a sysfs attribute of the
- event device. Depending on the type of operator, this key is also
- used to match against the value of a sysfs attribute.</para>
+ event device.</para>
</listitem>
</varlistentry>