summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2016-02-22 23:25:36 +0100
committerLennart Poettering <lennart@poettering.net>2016-02-22 23:25:36 +0100
commit4d080d7798c938c3accc8555182e5ef515967bae (patch)
treefa0cd771fa1a4abe08b40d1105055d22899e1c74 /src/udev
parent9fe436ae7d2f86851eb458b63d2a7a69ec020537 (diff)
parent916a8d4341cc2d188614fee011346f2df8daf86c (diff)
Merge pull request #2701 from keszybz/udev-rules
udev-rules cleanup fix
Diffstat (limited to 'src/udev')
-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;
}