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 /color.c | |
parent | d61c4ed8551e5ef5642f93acec0b5c3f84ebede9 (diff) | |
download | bfs-d40691e31e2674d7d95ec9160b9897805ce3f43b.tar.xz |
stat: Unify the flags arguments
Diffstat (limited to 'color.c')
-rw-r--r-- | color.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -542,7 +542,7 @@ int cfclose(CFILE *cfile) { /** Check if a symlink is broken. */ static bool is_link_broken(const struct BFTW *ftwbuf) { - if (ftwbuf->at_flags & AT_SYMLINK_NOFOLLOW) { + if (ftwbuf->stat_flags & BFS_STAT_NOFOLLOW) { return xfaccessat(ftwbuf->at_fd, ftwbuf->at_path, F_OK) != 0; } else { return true; @@ -710,7 +710,7 @@ static int print_path_colored(CFILE *cfile, const struct BFTW *ftwbuf) { /** Call stat() again to resolve a link target. */ static void restat(struct BFTW *ftwbuf, struct bfs_stat *statbuf) { - if (bfs_stat(ftwbuf->at_fd, ftwbuf->at_path, ftwbuf->at_flags, 0, statbuf) == 0) { + if (bfs_stat(ftwbuf->at_fd, ftwbuf->at_path, ftwbuf->stat_flags, statbuf) == 0) { ftwbuf->statbuf = statbuf; } } @@ -723,9 +723,9 @@ static int print_path(CFILE *cfile, const struct BFTW *ftwbuf) { } if (colors && colors->link_as_target) { - if (ftwbuf->typeflag == BFTW_LNK && (ftwbuf->at_flags & AT_SYMLINK_NOFOLLOW)) { + if (ftwbuf->typeflag == BFTW_LNK && (ftwbuf->stat_flags & BFS_STAT_NOFOLLOW)) { struct BFTW altbuf = *ftwbuf; - altbuf.at_flags = 0; + altbuf.stat_flags = BFS_STAT_FOLLOW; struct bfs_stat statbuf; restat(&altbuf, &statbuf); return print_path_colored(cfile, &altbuf); @@ -752,7 +752,7 @@ static int print_link_target(CFILE *cfile, const struct BFTW *ftwbuf) { struct BFTW altbuf = *ftwbuf; altbuf.path = target; altbuf.nameoff = xbasename(target) - target; - altbuf.at_flags = 0; + altbuf.stat_flags = BFS_STAT_FOLLOW; altbuf.statbuf = NULL; struct bfs_stat statbuf; |