aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2021-09-12 18:53:40 +0100
committerPádraig Brady <P@draigBrady.com>2021-09-12 23:16:18 +0100
commit0cfb60e90da0848406cf3bf35bb9273e6ef01dbc (patch)
tree3b07bd22bd90db50384587df53efbd7e3e8f9a38
parenttests: add new stdin reading programs to tty-eof test (diff)
downloadcoreutils-0cfb60e90da0848406cf3bf35bb9273e6ef01dbc.tar.gz
coreutils-0cfb60e90da0848406cf3bf35bb9273e6ef01dbc.zip
tests: stat-vs-dirent.sh: avoid a false failure
* tests/ls/stat-vs-dirent.sh: Skip the test if we can't stat(1), as the file may have been removed, or have a malformed name due to '\n' etc. in the file name.
-rwxr-xr-xtests/ls/stat-vs-dirent.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/ls/stat-vs-dirent.sh b/tests/ls/stat-vs-dirent.sh
index 4be4fadd1..d50ed6a67 100755
--- a/tests/ls/stat-vs-dirent.sh
+++ b/tests/ls/stat-vs-dirent.sh
@@ -32,7 +32,8 @@ while :; do
file=$(sed -n '1s/^ *[0-9][0-9]* //p;q' tmp)
# Get its inode number (stat.st_ino) via stat(1)'s call to lstat.
- st_ino=$(stat --format=%i "$t/$file")
+ st_ino=$(stat --format=%i "$t/$file") ||
+ skip_ "error stating: $t/$file" # removed or newlines in name etc.
# Make sure that they are the same.
# We know from experience that there may be mismatches on some