* 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.
# 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 <dlfcn.h>
#include <dirent.h>
#include <errno.h>
errno = ENOENT;
return NULL;
}
-
-struct dirent64 *readdir64 (DIR *dirp)
-{
- return (struct dirent64 *) readdir (dirp);
-}
EOF
# Then compile/link it: