diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-05-04 11:51:56 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-05-04 11:55:07 -0400 |
commit | d40691e31e2674d7d95ec9160b9897805ce3f43b (patch) | |
tree | 7b2a6c031a2808e7bc9c94e60c708595e3d7e7a8 /bftw.c | |
parent | d61c4ed8551e5ef5642f93acec0b5c3f84ebede9 (diff) | |
download | bfs-d40691e31e2674d7d95ec9160b9897805ce3f43b.tar.xz |
stat: Unify the flags arguments
Diffstat (limited to 'bftw.c')
-rw-r--r-- | bftw.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -751,7 +751,7 @@ static enum bftw_typeflag bftw_dirent_typeflag(const struct dirent *de) { /** Call stat() and use the results. */ static int bftw_stat(struct BFTW *ftwbuf, struct bfs_stat *sb) { - int ret = bfs_stat(ftwbuf->at_fd, ftwbuf->at_path, ftwbuf->at_flags, BFS_STAT_BROKEN_OK, sb); + int ret = bfs_stat(ftwbuf->at_fd, ftwbuf->at_path, ftwbuf->stat_flags, sb); if (ret == 0) { ftwbuf->statbuf = sb; ftwbuf->typeflag = bftw_mode_typeflag(sb->mode); @@ -877,7 +877,7 @@ static bool bftw_need_stat(struct bftw_state *state) { return true; } - if (ftwbuf->typeflag == BFTW_LNK && !(ftwbuf->at_flags & AT_SYMLINK_NOFOLLOW)) { + if (ftwbuf->typeflag == BFTW_LNK && !(ftwbuf->stat_flags & BFS_STAT_NOFOLLOW)) { return true; } @@ -918,7 +918,7 @@ static void bftw_prepare_visit(struct bftw_state *state) { ftwbuf->statbuf = NULL; ftwbuf->at_fd = AT_FDCWD; ftwbuf->at_path = ftwbuf->path; - ftwbuf->at_flags = AT_SYMLINK_NOFOLLOW; + ftwbuf->stat_flags = BFS_STAT_NOFOLLOW; if (dir) { ftwbuf->nameoff = dir->nameoff; @@ -957,7 +957,7 @@ static void bftw_prepare_visit(struct bftw_state *state) { } bool follow = state->flags & follow_flags; if (follow) { - ftwbuf->at_flags = 0; + ftwbuf->stat_flags = BFS_STAT_TRYFOLLOW; } if (bftw_need_stat(state)) { |