diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2016-02-23 10:09:42 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2016-02-23 10:09:42 -0500 |
commit | 55e2963668d7f2b4150e29c9b57652e3478eab75 (patch) | |
tree | 909151a42451d67c72b68c86381951df0d6a4b62 | |
parent | 626b1fd062faa08cbdf47f2ae0a2447ce248dda9 (diff) | |
download | bfs-55e2963668d7f2b4150e29c9b57652e3478eab75.tar.xz |
bftw: Update at_flags when not following a broken symbolic link.
-rw-r--r-- | bftw.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -763,7 +763,8 @@ static void bftw_init_buffers(struct bftw_state *state, const struct dirent *de) int ret = ftwbuf_stat(ftwbuf, &state->statbuf, ftwbuf->at_flags); if (ret != 0 && follow && errno == ENOENT) { // Could be a broken symlink, retry without following - ret = ftwbuf_stat(ftwbuf, &state->statbuf, AT_SYMLINK_NOFOLLOW); + ftwbuf->at_flags = AT_SYMLINK_NOFOLLOW; + ret = ftwbuf_stat(ftwbuf, &state->statbuf, ftwbuf->at_flags); } if (ret != 0) { |