From: Yu Watanabe Date: Thu, 16 Dec 2021 19:07:35 +0000 (+0900) Subject: Merge pull request #21786 from keszybz/dirent-work X-Git-Tag: v250-rc3~32 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=d9338387d94ad611233cf0753801eefccfda432a;p=systemd%2F.git Merge pull request #21786 from keszybz/dirent-work Make FOREACH_DIRENT and FOREACH_DIRENT_ALL declare the iterator variables --- d9338387d94ad611233cf0753801eefccfda432a diff --cc src/libsystemd/sd-device/sd-device.c index 8b6e1ddd69,c348bd8f0f..94ea61cc8d --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@@ -1812,10 -1811,10 +1811,10 @@@ static int device_sysattrs_read_all_int if (lstat(path, &statbuf) != 0) continue; - if (!(statbuf.st_mode & S_IRUSR)) + if ((statbuf.st_mode & (S_IRUSR | S_IWUSR)) == 0) continue; - r = set_put_strdup(&device->sysattrs, p ?: dent->d_name); + r = set_put_strdup(&device->sysattrs, p ?: de->d_name); if (r < 0) return r; }