From d9f7bf31d0693b81bddb7e8c57118dd7f78a2952 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 16 Jul 2024 16:06:14 -0400 Subject: xspawn: Test the right macro for posix_spawn_..._addfchdir() support 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}()") --- src/xspawn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/xspawn.c') diff --git a/src/xspawn.c b/src/xspawn.c index 2c64011..68973ad 100644 --- a/src/xspawn.c +++ b/src/xspawn.c @@ -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) { -- cgit v1.2.3