|
Zbigniew Jędrzejewski-Szmek |
436654 |
From be215abe14beac522e326be14ba44fcf989e4359 Mon Sep 17 00:00:00 2001
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
From: Tom Gundersen <teg@jklm.no>
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Date: Thu, 28 May 2015 17:18:33 +0200
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Subject: [PATCH] sd-device: enumerator - fix matching on properties and
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
sysattrs
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
This was a regression that broke
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
$ udevadm trigger -nv --property-match=DEVNAME=/dev/sda1 --attr-match=size=409600
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
Reported by David Reisner.
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
(cherry picked from commit 5f529f4c97a141457301477505ae7eb4c28cf610)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
---
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
src/libsystemd/sd-device/device-enumerator.c | 6 +++---
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
diff --git a/src/libsystemd/sd-device/device-enumerator.c b/src/libsystemd/sd-device/device-enumerator.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
index ce4862d7f0..3692d46e06 100644
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
--- a/src/libsystemd/sd-device/device-enumerator.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+++ b/src/libsystemd/sd-device/device-enumerator.c
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
@@ -367,11 +367,11 @@ static bool match_sysattr(sd_device_enumerator *enumerator, sd_device *device) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
assert(enumerator);
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
assert(device);
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
- HASHMAP_FOREACH_KEY(sysattr, value, enumerator->nomatch_sysattr, i)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+ HASHMAP_FOREACH_KEY(value, sysattr, enumerator->nomatch_sysattr, i)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
if (match_sysattr_value(device, sysattr, value))
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
return false;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
- HASHMAP_FOREACH_KEY(sysattr, value, enumerator->match_sysattr, i)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+ HASHMAP_FOREACH_KEY(value, sysattr, enumerator->match_sysattr, i)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
if (!match_sysattr_value(device, sysattr, value))
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
return false;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
@@ -389,7 +389,7 @@ static bool match_property(sd_device_enumerator *enumerator, sd_device *device)
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
if (hashmap_isempty(enumerator->match_property))
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
return true;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
- HASHMAP_FOREACH_KEY(property, value, enumerator->match_property, i) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
+ HASHMAP_FOREACH_KEY(value, property, enumerator->match_property, i) {
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
const char *property_dev, *value_dev;
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
|
|
Zbigniew Jędrzejewski-Szmek |
436654 |
FOREACH_DEVICE_PROPERTY(device, property_dev, value_dev) {
|