summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2007-08-16 12:45:31 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-08-16 12:45:31 +0200
commit03f65fe6a9cd32a5861b1a929cdf4f7eddbd593f (patch)
treeed5297ceae0511ba4a31bb92dd312da7c7136358 /udev_rules.c
parent88b74dc69226ff64e5ab7a80077f331729202083 (diff)
accept relative path for TEST
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/udev_rules.c b/udev_rules.c
index e2877abe70..0dcbf156ea 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -1003,6 +1003,14 @@ static int match_rule(struct udevice *udev, struct udev_rule *rule)
strlcat(filename, "/", sizeof(filename));
strlcat(filename, attr, sizeof(filename));
}
+ } else if (filename[0] != '/') {
+ char tmp[PATH_SIZE];
+
+ strlcpy(tmp, sysfs_path, sizeof(tmp));
+ strlcat(tmp, udev->dev->devpath, sizeof(tmp));
+ strlcat(tmp, "/", sizeof(tmp));
+ strlcat(tmp, filename, sizeof(tmp));
+ strlcpy(filename, tmp, sizeof(filename));
}
match = (stat(filename, &statbuf) == 0);