]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Also allow a slightly different diagnostic -- the
authorJim Meyering <jim@meyering.net>
Tue, 3 Jan 2006 14:12:16 +0000 (14:12 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 3 Jan 2006 14:12:16 +0000 (14:12 +0000)
one you get when using openat-enabled fts.c and du (coming soon).

tests/du/no-x

index c5f56b035b3b8b7e90763cbb020481e3d24db5e5..e1d400ae6b745c21fbf45e8606554ce7fdf21297 100755 (executable)
@@ -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