summaryrefslogtreecommitdiff
path: root/src/shared/clean-ipc.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-01 22:43:28 -0500
committerGitHub <noreply@github.com>2017-02-01 22:43:28 -0500
commitf7dda6c625c7b12a1d4635a679e442250a0f69f0 (patch)
tree9f585f8d382e8a388b06711caf418fcfe5ee6abe /src/shared/clean-ipc.c
parentef2f4f911b6a6499db4468570ed868add45b3069 (diff)
parent9ff233dc1fa2f47fc4499a12a8ee0640aba30657 (diff)
Merge pull request #5203 from poettering/dotdot
trivial unification of checking for "." and ".." when iterating through directories...
Diffstat (limited to 'src/shared/clean-ipc.c')
-rw-r--r--src/shared/clean-ipc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c
index f2d1555c13..f59f6f23ae 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) {
@@ -310,7 +310,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) {