[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] tests: ls/stat-vs-dirent: avoid spurious test failure
From: |
Jim Meyering |
Subject: |
[PATCH] tests: ls/stat-vs-dirent: avoid spurious test failure |
Date: |
Sat, 05 Sep 2009 19:16:38 +0200 |
I noticed this test fail when run from this directory:
/dev/shm/.j/coreutils-7.5.54-70ea
Here's the fix:
>From c392c4b8ef5de84d67d354bb2ecdd544466c50c8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Sat, 5 Sep 2009 19:06:31 +0200
Subject: [PATCH] tests: ls/stat-vs-dirent: avoid spurious test failure
* tests/ls/stat-vs-dirent: Avoid test failure when run from a
directory whose name (or ancestor directory name) starts with ".".
---
tests/ls/stat-vs-dirent | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/tests/ls/stat-vs-dirent b/tests/ls/stat-vs-dirent
index 064ec12..9f2b149 100755
--- a/tests/ls/stat-vs-dirent
+++ b/tests/ls/stat-vs-dirent
@@ -43,7 +43,10 @@ while :; do
# Make sure that they are the same.
# We know from experience that there may be mismatches on some
# buggy file systems, at mount points.
- if test "$d_ino" != "$st_ino"; then
+ # Note that when a directory contains only entries whose names
+ # start with ".", d_ino and file will both be empty. In that case,
+ # skip the test.
+ if test -n "$d_ino" && test "$d_ino" != "$st_ino"; then
echo "$0: test failed: $t/$file: d_ino($d_ino) != st_ino($st_ino)
This may indicate a flaw in your kernel or file system implementation.
The flaw isn't serious for coreutils, but it might break other tools,
--
1.6.4.2.409.g85dc3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] tests: ls/stat-vs-dirent: avoid spurious test failure,
Jim Meyering <=