diff options
author | Bernhard Voelker <mail@bernhard-voelker.de> | 2021-12-31 02:13:56 +0100 |
---|---|---|
committer | Bernhard Voelker <mail@bernhard-voelker.de> | 2021-12-31 02:13:56 +0100 |
commit | 71556793c19bfa01d5f7d66833b0564cfcac3879 (patch) | |
tree | 057b30abe819bd7088c52523159d6cb50afa57df /tests/find | |
parent | a8e60e7437a6a1682f5d9caf77fd4a5940024c54 (diff) | |
download | findutils-71556793c19bfa01d5f7d66833b0564cfcac3879.tar.gz |
tests: avoid FP from 'find -files0-from DIR' on certain platforms
On most modern systems like GNU/Linux, read(2)-ing from a directory file
descriptor will fail with EISDIR, but it succeeds e.g. on GNU/Hurd and
AIX-7.1/AIX-7.2.
tests/find/files0-from.sh: Skip the test case excercising a directory
argument for the -files0-from option when the system allows reading
from a directory.
Diffstat (limited to 'tests/find')
-rwxr-xr-x | tests/find/files0-from.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/find/files0-from.sh b/tests/find/files0-from.sh index 4864a866..dfea8616 100755 --- a/tests/find/files0-from.sh +++ b/tests/find/files0-from.sh @@ -89,9 +89,14 @@ if test -e $f && test '!' -r $f; then fi # Exercise a directory argument. -returns_ 1 find -files0-from / > out 2> err \ - && grep 'read error' err \ - || { grep . out err; fail=1; } +# On most modern systems like GNU/Linux, read(2)-ing from a directory file +# descriptor will fail with EISDIR. Skip on other plaforms where that succeeds, +# e.g. on GNU/Hurd and AIX. +if returns_ 1 cat / >/dev/null; then + returns_ 1 find -files0-from / > out 2> err \ + && grep 'read error' err \ + || { grep . out err; fail=1; } +fi # Exercise an empty input file. find -files0-from /dev/null > out 2> err || fail=1 |