diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-01 22:43:28 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-01 22:43:28 -0500 |
commit | f7dda6c625c7b12a1d4635a679e442250a0f69f0 (patch) | |
tree | 9f585f8d382e8a388b06711caf418fcfe5ee6abe /src/tmpfiles/tmpfiles.c | |
parent | ef2f4f911b6a6499db4468570ed868add45b3069 (diff) | |
parent | 9ff233dc1fa2f47fc4499a12a8ee0640aba30657 (diff) |
Merge pull request #5203 from poettering/dotdot
trivial unification of checking for "." and ".." when iterating through directories...
Diffstat (limited to 'src/tmpfiles/tmpfiles.c')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index f4ce9791fb..c4f4d46ca1 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -385,7 +385,7 @@ static int dir_cleanup( usec_t age; _cleanup_free_ char *sub_path = NULL; - if (STR_IN_SET(dent->d_name, ".", "..")) + if (dot_or_dot_dot(dent->d_name)) continue; if (fstatat(dirfd(d), dent->d_name, &s, AT_SYMLINK_NOFOLLOW) < 0) { @@ -1070,9 +1070,7 @@ static int item_do_children(Item *i, const char *path, action_t action) { _cleanup_free_ char *p = NULL; int q; - errno = 0; - - if (STR_IN_SET(de->d_name, ".", "..")) + if (dot_or_dot_dot(de->d_name)) continue; p = strjoin(path, "/", de->d_name); |