diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-02-02 00:06:18 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2017-07-17 17:58:36 +0200 |
commit | 321384507f1223033fc0fb2969f6e29598ba7d92 (patch) | |
tree | 09ad09aed5e0cb8fd44a6cdf95cf11fd27038a62 /src/shared | |
parent | de3f86951e5c91756ea9d9b5c9e381b6f293a3be (diff) |
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...
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/clean-ipc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c index ba48fb0ec..3b4231827 100644 --- a/src/shared/clean-ipc.c +++ b/src/shared/clean-ipc.c @@ -225,7 +225,7 @@ static int clean_posix_shm_internal(DIR *dir, uid_t uid, gid_t gid) { FOREACH_DIRENT_ALL(de, dir, goto fail) { struct stat st; - if (STR_IN_SET(de->d_name, "..", ".")) + if (dot_or_dot_dot(de->d_name)) continue; if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { @@ -311,7 +311,7 @@ static int clean_posix_mq(uid_t uid, gid_t gid) { struct stat st; char fn[1+strlen(de->d_name)+1]; - if (STR_IN_SET(de->d_name, "..", ".")) + if (dot_or_dot_dot(de->d_name)) continue; if (fstatat(dirfd(dir), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0) { |