summaryrefslogtreecommitdiff
path: root/tests/du
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-01-03 14:12:16 +0000
committerJim Meyering <jim@meyering.net>2006-01-03 14:12:16 +0000
commit8e702fc759e105eb695244c78ad867cc16b8c132 (patch)
treeb30b5cd91b6378677a540bb740ac42637212df0d /tests/du
parentb9c62b6747ba23b559e89164f0654f53d8ba6210 (diff)
downloadcoreutils-8e702fc759e105eb695244c78ad867cc16b8c132.tar.xz
Also allow a slightly different diagnostic -- the
one you get when using openat-enabled fts.c and du (coming soon).
Diffstat (limited to 'tests/du')
-rwxr-xr-xtests/du/no-x18
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/du/no-x b/tests/du/no-x
index c5f56b035..e1d400ae6 100755
--- a/tests/du/no-x
+++ b/tests/du/no-x
@@ -30,11 +30,27 @@ fail=0
# This must exit nonzero.
du d >/dev/null 2>out && fail=1
+
cat <<\EOF > exp
du: `d/no-x': Permission denied
EOF
-cmp out exp || fail=1
+# With native openat, du uses a different code path.
+cat <<\EOF > exp-native-openat
+du: cannot access `d/no-x/y': Permission denied
+du: fts_read failed: Permission denied
+EOF
+
+if cmp out exp >/dev/null 2>&1; then
+ :
+else
+ if cmp out exp-native-openat; then
+ :
+ else
+ fail=1
+ fi
+fi
+
test $fail = 1 && diff out exp 2> /dev/null
(exit $fail); exit $fail