diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-07-09 16:35:38 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-07-09 16:35:38 -0400 |
commit | 2328d8dbb5a8c774afb99d363b6e98cd25ee304d (patch) | |
tree | 53822ecfebc872335e9b13f2fb255f0b2aa808d6 /tests.sh | |
parent | f4eed3b771a987ef441fea49ababc356a2933086 (diff) | |
download | bfs-2328d8dbb5a8c774afb99d363b6e98cd25ee304d.tar.xz |
Handle ENOTDIR the same as ENOENT
For a/b/c, ENOTDIR is returned instead of ENOENT if a or b are not
directories. Handle this uniformly when detecting broken symlinks,
readdir races, etc.
Diffstat (limited to 'tests.sh')
-rwxr-xr-x | tests.sh | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -74,6 +74,7 @@ function make_links() { ln -s ../../d "$1/d/e/g" ln -s d/e "$1/h" ln -s q "$1/d/e/i" + ln -s b/c "$1/j" } make_links "$TMP/links" @@ -299,6 +300,7 @@ gnu_tests=( test_flag_double_dash test_ignore_readdir_race test_ignore_readdir_race_root + test_ignore_readdir_race_notdir test_perm_222_slash test_perm_644_slash test_perm_symbolic_slash @@ -797,6 +799,14 @@ function test_ignore_readdir_race_root() { ! $BFS basic/nonexistent -ignore_readdir_race 2>/dev/null } +function test_ignore_readdir_race_notdir() { + # Check -ignore_readdir_race handling when a directory is replaced with a file + rm -rf scratch/* + touchp scratch/foo/bar + + $BFS scratch -mindepth 1 -ignore_readdir_race -execdir rm -r '{}' \; -execdir touch '{}' \; +} + function test_perm_222() { bfs_diff perms -perm 222 } |