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
@@ -331,7 +331,7 @@ static int fd_copy_directory(
struct stat buf;
int q;
if (STR_IN_SET(de->d_name, ".", ".."))
if (dot_or_dot_dot(de->d_name))
continue;
if (fstatat(dirfd(d), de->d_name, &buf, AT_SYMLINK_NOFOLLOW) < 0) {