Skip to content

Commit 9087bdf

Browse files
committed
Rename posix_spawn_file_actions_addchdir polyfill
We shouldn't name our polyfill the same as the POSIX function; this would infinite loop on Solaris or NetBSD for example.
1 parent 19db29b commit 9087bdf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Basic/Subprocess.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ int pthread_fchdir_np(int fd)
7777

7878
#if !defined(_WIN32) && defined(HAVE_POSIX_SPAWN)
7979
// Implementation mostly copied from _CFPosixSpawnFileActionsChdir in swift-corelibs-foundation
80-
static int posix_spawn_file_actions_addchdir(posix_spawn_file_actions_t * __restrict file_actions,
81-
const char * __restrict path) {
80+
static int posix_spawn_file_actions_addchdir_polyfill(posix_spawn_file_actions_t * __restrict file_actions,
81+
const char * __restrict path) {
8282
#if defined(__GLIBC__) && !__GLIBC_PREREQ(2, 29)
8383
// Glibc versions prior to 2.29 don't support posix_spawn_file_actions_addchdir_np, impacting:
8484
// - Amazon Linux 2 (EoL mid-2025)
@@ -779,7 +779,7 @@ void llbuild::basic::spawnProcess(
779779
bool usePosixSpawnChdirFallback = true;
780780
const auto workingDir = attr.workingDir.str();
781781
if (!workingDir.empty() &&
782-
posix_spawn_file_actions_addchdir(&fileActions, workingDir.c_str()) != ENOSYS) {
782+
posix_spawn_file_actions_addchdir_polyfill(&fileActions, workingDir.c_str()) != ENOSYS) {
783783
usePosixSpawnChdirFallback = false;
784784
}
785785

0 commit comments

Comments
 (0)