From 505843eec93696d3fab69e56c34c578c8d032951 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 9 Apr 2024 16:36:25 -0400 Subject: xspawn: Fix $PATH resolution on NetBSD 10 --- src/xspawn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/xspawn.c b/src/xspawn.c index 065fbae..347625d 100644 --- a/src/xspawn.c +++ b/src/xspawn.c @@ -209,10 +209,10 @@ int bfs_spawn_adddup2(struct bfs_spawn *ctx, int oldfd, int newfd) { * PATH ..., using the working directory of the child process after all * file_actions have been performed. * - * but macOS resolves the PATH *before* file_actions (because there + * but macOS and NetBSD resolve the PATH *before* file_actions (because there * posix_spawn() is its own syscall). */ -#define BFS_POSIX_SPAWNP_AFTER_FCHDIR !__APPLE__ +#define BFS_POSIX_SPAWNP_AFTER_FCHDIR !(__APPLE__ || __NetBSD_Prereq__(10, 0, 0)) int bfs_spawn_addfchdir(struct bfs_spawn *ctx, int fd) { struct bfs_spawn_action *action = bfs_spawn_action(BFS_SPAWN_FCHDIR); -- cgit v1.2.3