fs-util: unify code we use to check if dirent's d_name is "." or ".."

We use different idioms at different places. Let's replace this is the
one true new idiom, that is even a bit faster...
This commit is contained in:
Lennart Poettering
2017-02-02 00:06:18 +01:00
parent 1d0106996c
commit 49bfc8774b
12 changed files with 43 additions and 20 deletions
+1 -1
View File
@@ -375,7 +375,7 @@ static int recurse_fd(int fd, bool donate_fd, const struct stat *st, uid_t shift
FOREACH_DIRENT_ALL(de, d, r = -errno; goto finish) {
struct stat fst;
if (STR_IN_SET(de->d_name, ".", ".."))
if (dot_or_dot_dot(de->d_name))
continue;
if (fstatat(dirfd(d), de->d_name, &fst, AT_SYMLINK_NOFOLLOW) < 0) {