mirror of
https://github.com/AuxXxilium/eudev.git
synced 2025-01-24 08:00:08 +07:00
make WAIT_FOR_SYSFS usable in non "wait-only" rules
Thanks to Andrey Borzenkov <arvidjaar@mail.ru> for noticing this and the initial patch to fix it. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
parent
66c2bc2120
commit
f8db897faa
16
udev_rules.c
16
udev_rules.c
@ -733,19 +733,13 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
|
||||
}
|
||||
|
||||
if (rule->wait_for_sysfs.operation != KEY_OP_UNSET) {
|
||||
int match;
|
||||
int found;
|
||||
|
||||
match = (wait_for_sysfs(udev, key_val(rule, &rule->wait_for_sysfs), 3) == 0);
|
||||
if (match && (rule->wait_for_sysfs.operation != KEY_OP_NOMATCH)) {
|
||||
dbg("WAIT_FOR_SYSFS is true (matching value)");
|
||||
return 0;
|
||||
found = (wait_for_sysfs(udev, key_val(rule, &rule->wait_for_sysfs), 3) == 0);
|
||||
if (!found && (rule->wait_for_sysfs.operation != KEY_OP_NOMATCH)) {
|
||||
dbg("WAIT_FOR_SYSFS failed");
|
||||
goto nomatch;
|
||||
}
|
||||
if (!match && (rule->wait_for_sysfs.operation == KEY_OP_NOMATCH)) {
|
||||
dbg("WAIT_FOR_SYSFS is true, (non matching value)");
|
||||
return 0;
|
||||
}
|
||||
dbg("WAIT_FOR_SYSFS is false");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* walk up the chain of parent devices and find a match */
|
||||
|
Loading…
Reference in New Issue
Block a user