From: Pádraig Brady
Date: Wed, 6 Jul 2016 17:08:32 +0000 (+0100)
Subject: tests: avoid false failure on 32 bit in readdir() test
X-Git-Tag: v8.26~94
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=54c1397510cb08433680b5b7da46a8201770e9ee;p=thirdparty%2Fcoreutils.git
tests: avoid false failure on 32 bit in readdir() test
* tests/rm/rm-readdir-fail.sh: Since we use the returned dirent
from the readdir wrapper it must be the correct type and not
just cast. Therefore setup so that we only have to define a
wrapper for readdir(), which works appropriately on 32 and 64 bit.
Issue reported by Bernhard Voelker, where rm was seen to invoke
rmdir() on invalid file names.
---
diff --git a/tests/rm/rm-readdir-fail.sh b/tests/rm/rm-readdir-fail.sh
index 15ef1d6c44..d9d8efdb4d 100755
--- a/tests/rm/rm-readdir-fail.sh
+++ b/tests/rm/rm-readdir-fail.sh
@@ -26,6 +26,12 @@ mkdir -p dir/notempty || framework_failure_
# Simulate "readdir" failure.
cat > k.c <<\EOF || framework_failure_
#define _GNU_SOURCE
+
+/* Setup so we don't have to worry about readdir64. */
+#ifndef __LP64__
+# define _FILE_OFFSET_BITS 64
+#endif
+
#include