From owner-dev-commits-src-all@freebsd.org Tue Jul 6 10:07:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 3A5236551CD; Tue, 6 Jul 2021 10:07:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GJysT6jNlz4tsG; Tue, 6 Jul 2021 10:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9E80B17976; Tue, 6 Jul 2021 10:07:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 166A7PGq018409; Tue, 6 Jul 2021 10:07:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 166A7PmD018408; Tue, 6 Jul 2021 10:07:25 GMT (envelope-from git) Date: Tue, 6 Jul 2021 10:07:25 GMT Message-Id: <202107061007.166A7PmD018408@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alex Richardson Subject: git: e34c713b0e66 - main - rtld/tests: Avoid function name conflict with libc opendir() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e34c713b0e660a49b57fafc02c9eccb26b938220 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2021 10:07:26 -0000 The branch main has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=e34c713b0e660a49b57fafc02c9eccb26b938220 commit e34c713b0e660a49b57fafc02c9eccb26b938220 Author: Alex Richardson AuthorDate: 2021-07-06 09:51:57 +0000 Commit: Alex Richardson CommitDate: 2021-07-06 09:51:57 +0000 rtld/tests: Avoid function name conflict with libc opendir() This prevents these tests from being compiled with ASAN since the asan interceptors also define opendir() but matching the libc function. Reviewed By: oshogbo, kib, markj Differential Revision: https://reviews.freebsd.org/D31038 --- libexec/rtld-elf/tests/common.c | 2 +- libexec/rtld-elf/tests/common.h | 2 +- libexec/rtld-elf/tests/ld_library_pathfds.c | 4 ++-- libexec/rtld-elf/tests/ld_preload_fds.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libexec/rtld-elf/tests/common.c b/libexec/rtld-elf/tests/common.c index 6eb3edfbc14c..82dd5180b582 100644 --- a/libexec/rtld-elf/tests/common.c +++ b/libexec/rtld-elf/tests/common.c @@ -67,7 +67,7 @@ try_to_run(int binary, int exit_status, char * const *env, } int -opendir(const char *name) +opendir_fd(const char *name) { return open(name, O_RDONLY | O_DIRECTORY); diff --git a/libexec/rtld-elf/tests/common.h b/libexec/rtld-elf/tests/common.h index d5bf2050dcfd..12a9eec36eb5 100644 --- a/libexec/rtld-elf/tests/common.h +++ b/libexec/rtld-elf/tests/common.h @@ -37,7 +37,7 @@ void expect_missing_library(int binary, char *senv); 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_ */ diff --git a/libexec/rtld-elf/tests/ld_library_pathfds.c b/libexec/rtld-elf/tests/ld_library_pathfds.c index bc0627d4c3d5..ed9f51c175fa 100644 --- a/libexec/rtld-elf/tests/ld_library_pathfds.c +++ b/libexec/rtld-elf/tests/ld_library_pathfds.c @@ -159,12 +159,12 @@ static void 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); } diff --git a/libexec/rtld-elf/tests/ld_preload_fds.c b/libexec/rtld-elf/tests/ld_preload_fds.c index 3a220b009bb6..99378b549de5 100644 --- a/libexec/rtld-elf/tests/ld_preload_fds.c +++ b/libexec/rtld-elf/tests/ld_preload_fds.c @@ -39,7 +39,7 @@ setup(const atf_tc_t *tc) { 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);