diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-11-23 21:18:31 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-11-23 21:18:31 -0500 |
commit | 6b820421d9ffe0599d9ff3f20703b2e2a04e4af8 (patch) | |
tree | b6c8782c156dff26fb6d60ee661f88b9c505e0c7 | |
parent | 155d3b1b42d33062e8ad471e3d3ae966e5a3ad63 (diff) |
bftw: Infer the flags in ftwbuf_stat()
-rw-r--r-- | bftw.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,6 +1,6 @@ /********************************************************************* * bfs * - * Copyright (C) 2015 Tavian Barnes <tavianator@tavianator.com> * + * Copyright (C) 2015-2016 Tavian Barnes <tavianator@tavianator.com> * * * * 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) { |