Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654)
The hppa port starts libc at GLIBC_2.2, but has earlier symbol
versions in other shared objects. This means that the compat
symbol for readdir64 is not actually present in libc even though
have-GLIBC_2.1.3 is defined as yes at the make level.
Fixes commit 15e50e6c96
("Linux:
dirent/tst-readdir64-compat can be a regular test") by mostly
reverting it.
This commit is contained in:
parent
ca4d3ea513
commit
0c5605989f
|
@ -361,12 +361,10 @@ inhibit-glue = yes
|
||||||
|
|
||||||
ifeq ($(subdir),dirent)
|
ifeq ($(subdir),dirent)
|
||||||
sysdep_routines += getdirentries getdirentries64
|
sysdep_routines += getdirentries getdirentries64
|
||||||
tests += tst-getdents64
|
tests += \
|
||||||
|
tst-getdents64 \
|
||||||
# The tested readdir64 symbol was replaced in glibc 2.2.
|
tst-readdir64-compat \
|
||||||
ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
|
# tests
|
||||||
tests += tst-readdir64-compat
|
|
||||||
endif
|
|
||||||
endif # $(subdir) == dirent
|
endif # $(subdir) == dirent
|
||||||
|
|
||||||
ifeq ($(subdir),nis)
|
ifeq ($(subdir),nis)
|
||||||
|
|
|
@ -37,12 +37,15 @@ struct __old_dirent64
|
||||||
|
|
||||||
typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
|
typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
|
||||||
|
|
||||||
|
#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
|
||||||
struct __old_dirent64 *compat_readdir64 (DIR *);
|
struct __old_dirent64 *compat_readdir64 (DIR *);
|
||||||
compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
|
compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
|
||||||
|
#endif
|
||||||
|
|
||||||
static int
|
static int
|
||||||
do_test (void)
|
do_test (void)
|
||||||
{
|
{
|
||||||
|
#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
|
||||||
/* Directory stream using the non-compat readdir64 symbol. The test
|
/* Directory stream using the non-compat readdir64 symbol. The test
|
||||||
checks against this. */
|
checks against this. */
|
||||||
DIR *dir_reference = opendir (".");
|
DIR *dir_reference = opendir (".");
|
||||||
|
@ -104,6 +107,7 @@ do_test (void)
|
||||||
|
|
||||||
TEST_COMPARE (closedir (dir_test), 0);
|
TEST_COMPARE (closedir (dir_test), 0);
|
||||||
TEST_COMPARE (closedir (dir_reference), 0);
|
TEST_COMPARE (closedir (dir_reference), 0);
|
||||||
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue