Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions cbits/posix/posix_spawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,14 +135,20 @@ do_spawn_posix (char *const args[],
}

if (workingDirectory) {
#if defined(HAVE_posix_spawn_file_actions_addchdir_np)
// N.B. this function is broken on macOS.
// See https://github.com/rust-lang/rust/pull/80537.
#if defined(HAVE_posix_spawn_file_actions_addchdir)
r = posix_spawn_file_actions_addchdir(&fa, workingDirectory);
if (r != 0) {
*failed_doing = "posix_spawn_file_actions_addchdir";
goto fail;
}
#elif defined(HAVE_posix_spawn_file_actions_addchdir_np)
// N.B. this function is broken on macOS.
// See https://github.com/rust-lang/rust/pull/80537.
r = posix_spawn_file_actions_addchdir_np(&fa, workingDirectory);
if (r != 0) {
*failed_doing = "posix_spawn_file_actions_addchdir_np";
goto fail;
}
#else
goto not_supported;
#endif
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ AC_CHECK_FUNCS([pipe2],[],[],[

# posix_spawn checks
AC_CHECK_HEADERS([spawn.h])
AC_CHECK_FUNCS([posix_spawnp posix_spawn_file_actions_addchdir],[],[],[
AC_CHECK_FUNCS([posix_spawnp posix_spawn_file_actions_addchdir_np posix_spawn_file_actions_addchdir],[],[],[
#define _GNU_SOURCE
#include <spawn.h>
])
Expand Down