summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-07-16 16:06:14 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-07-16 16:10:00 -0400
commitd9f7bf31d0693b81bddb7e8c57118dd7f78a2952 (patch)
tree7a1dfc098ccc972153a37a20c7c9c0947615a9d5
parentb00f769d90a75b7fad991f4b6d26f648142c200d (diff)
downloadbfs-d9f7bf31d0693b81bddb7e8c57118dd7f78a2952.tar.xz
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}()")
-rw-r--r--src/xspawn.c2
1 files changed, 1 insertions, 1 deletions
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) {