summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/udev/udev-rules.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
index 8470456d4c..475856db6f 100644
--- a/src/udev/udev-rules.c
+++ b/src/udev/udev-rules.c
@@ -705,10 +705,10 @@ static void attr_subst_subdir(char *attr, size_t len) {
for (dent = readdir(dir); dent != NULL; dent = readdir(dir))
if (dent->d_name[0] != '.') {
- char n[strlen(dent->d_name) + 1 + strlen(tail) + 1];
+ char n[strlen(dent->d_name) + strlen(tail) + 1];
- strscpyl(n, sizeof n, dent->d_name, "/", tail, NULL);
- if (faccessat(dirfd(dir), n, F_OK, 0)) {
+ strscpyl(n, sizeof n, dent->d_name, tail, NULL);
+ if (faccessat(dirfd(dir), n, F_OK, 0) == 0) {
strscpyl(attr, len, path, n, NULL);
break;
}