diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-05-27 13:37:49 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-05-27 14:04:39 -0400 |
commit | f095481862ccd175d297da67d0e313d135bd75c3 (patch) | |
tree | a98a6c1bce4e0eed3c844794b882707b5bc7396d /src/bftw.c | |
parent | 92a4f07352c6afd7b02785f94249daa2ad693bdd (diff) | |
download | bfs-f095481862ccd175d297da67d0e313d135bd75c3.tar.xz |
eval: Print more information on filesystem loops
Diffstat (limited to 'src/bftw.c')
-rw-r--r-- | src/bftw.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1676,6 +1676,7 @@ static void bftw_init_ftwbuf(struct bftw_state *state, enum bftw_visit visit) { ftwbuf->visit = visit; ftwbuf->type = BFS_UNKNOWN; ftwbuf->error = state->direrror; + ftwbuf->loopoff = 0; ftwbuf->at_fd = AT_FDCWD; ftwbuf->at_path = ftwbuf->path; bftw_stat_init(&ftwbuf->stat_bufs, &state->stat_buf, &state->lstat_buf); @@ -1733,6 +1734,7 @@ static void bftw_init_ftwbuf(struct bftw_state *state, enum bftw_visit visit) { if (ancestor->dev == statbuf->dev && ancestor->ino == statbuf->ino) { ftwbuf->type = BFS_ERROR; ftwbuf->error = ELOOP; + ftwbuf->loopoff = ancestor->nameoff + ancestor->namelen; return; } } |