Index: libexec/rtld-elf/tests/common.h =================================================================== --- libexec/rtld-elf/tests/common.h +++ libexec/rtld-elf/tests/common.h @@ -37,7 +37,7 @@ void try_to_run(int binary, int expected_exit_status, char * const *env, const char *expected_out, const char *expected_err); -int opendir(const char *name); +int opendir_fd(const char *name); int opendirat(int parent, const char *name); #endif /* _LD_COMMON_H_ */ Index: libexec/rtld-elf/tests/common.c =================================================================== --- libexec/rtld-elf/tests/common.c +++ libexec/rtld-elf/tests/common.c @@ -67,7 +67,7 @@ } int -opendir(const char *name) +opendir_fd(const char *name) { return open(name, O_RDONLY | O_DIRECTORY); Index: libexec/rtld-elf/tests/ld_library_pathfds.c =================================================================== --- libexec/rtld-elf/tests/ld_library_pathfds.c +++ libexec/rtld-elf/tests/ld_library_pathfds.c @@ -159,12 +159,12 @@ setup(struct descriptors *dp, const atf_tc_t *tc) { - dp->testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); + dp->testdir = opendir_fd(atf_tc_get_config_var(tc, "srcdir")); ATF_REQUIRE(dp->testdir >= 0); ATF_REQUIRE( (dp->binary = openat(dp->testdir, TARGET_ELF_NAME, O_RDONLY)) >= 0); - ATF_REQUIRE((dp->root = opendir("/")) >= 0); + ATF_REQUIRE((dp->root = opendir_fd("/")) >= 0); ATF_REQUIRE((dp->etc = opendirat(dp->root, "etc")) >= 0); ATF_REQUIRE((dp->usr = opendirat(dp->root, "usr")) >= 0); } Index: libexec/rtld-elf/tests/ld_preload_fds.c =================================================================== --- libexec/rtld-elf/tests/ld_preload_fds.c +++ libexec/rtld-elf/tests/ld_preload_fds.c @@ -39,7 +39,7 @@ { int testdir; - testdir = opendir(atf_tc_get_config_var(tc, "srcdir")); + testdir = opendir_fd(atf_tc_get_config_var(tc, "srcdir")); ATF_REQUIRE(testdir >= 0); binaryfd = openat(testdir, TARGET_ELF_NAME, O_RDONLY);