From 6b820421d9ffe0599d9ff3f20703b2e2a04e4af8 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 23 Nov 2016 21:18:31 -0500 Subject: bftw: Infer the flags in ftwbuf_stat() --- bftw.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'bftw.c') diff --git a/bftw.c b/bftw.c index 0cf5c49..6205d79 100644 --- a/bftw.c +++ b/bftw.c @@ -1,6 +1,6 @@ /********************************************************************* * bfs * - * Copyright (C) 2015 Tavian Barnes * + * Copyright (C) 2015-2016 Tavian Barnes * * * * This program is free software. It comes without any warranty, to * * the extent permitted by applicable law. You can redistribute it * @@ -525,8 +525,8 @@ static void ftwbuf_use_dirent(struct BFTW *ftwbuf, const struct dirent *de) { } /** Call stat() and use the results. */ -static int ftwbuf_stat(struct BFTW *ftwbuf, struct stat *sb, int flags) { - int ret = fstatat(ftwbuf->at_fd, ftwbuf->at_path, sb, flags); +static int ftwbuf_stat(struct BFTW *ftwbuf, struct stat *sb) { + int ret = fstatat(ftwbuf->at_fd, ftwbuf->at_path, sb, ftwbuf->at_flags); if (ret != 0) { return ret; } @@ -804,11 +804,11 @@ static void bftw_init_buffers(struct bftw_state *state, const struct dirent *de) || ftwbuf->typeflag == BFTW_UNKNOWN || (ftwbuf->typeflag == BFTW_LNK && follow) || (ftwbuf->typeflag == BFTW_DIR && (detect_cycles || xdev))) { - int ret = ftwbuf_stat(ftwbuf, &state->statbuf, ftwbuf->at_flags); + int ret = ftwbuf_stat(ftwbuf, &state->statbuf); if (ret != 0 && follow && errno == ENOENT) { // Could be a broken symlink, retry without following ftwbuf->at_flags = AT_SYMLINK_NOFOLLOW; - ret = ftwbuf_stat(ftwbuf, &state->statbuf, ftwbuf->at_flags); + ret = ftwbuf_stat(ftwbuf, &state->statbuf); } if (ret != 0) { -- cgit v1.2.3