Skip to content

Commit

Permalink
xspawn: Test the right macro for posix_spawn_..._addfchdir() support
Browse files Browse the repository at this point in the history
This should have been benign (just a performance regression), but
FreeBSD has a bug that causes the fork()-based fallback to lock up when
ASAN is enabled, due to fork() and dl_iterate_phdr().  This is not a
complete workaround for that issue, since the fork() fallback may be
used for other reasons.

Fixes: 29ddac2 ("config: Check for posix_spawn_file_actions_addfchdir{,_np}()")
  • Loading branch information
tavianator committed Jul 16, 2024
1 parent b00f769 commit d9f7bf3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xspawn.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int bfs_spawn_addfchdir(struct bfs_spawn *ctx, int fd) {
# define BFS_POSIX_SPAWN_ADDFCHDIR posix_spawn_file_actions_addfchdir_np
#endif

#if _POSIX_SPAWN > 0 && defined(BFS_POSIX_SPAWN_FCHDIR)
#if _POSIX_SPAWN > 0 && defined(BFS_POSIX_SPAWN_ADDFCHDIR)
if (ctx->flags & BFS_SPAWN_USE_POSIX) {
errno = BFS_POSIX_SPAWN_ADDFCHDIR(&ctx->actions, fd);
if (errno != 0) {
Expand Down

0 comments on commit d9f7bf3

Please sign in to comment.