From d40691e31e2674d7d95ec9160b9897805ce3f43b Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 4 May 2019 11:51:56 -0400 Subject: stat: Unify the flags arguments --- color.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'color.c') diff --git a/color.c b/color.c index 17d59e6..726c40f 100644 --- a/color.c +++ b/color.c @@ -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; -- cgit v1.2.3