summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-04-09 16:36:25 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-04-09 16:36:42 -0400
commit505843eec93696d3fab69e56c34c578c8d032951 (patch)
tree39508856c2b5427b1f471f63fa4d5810091af5d2 /src
parent1109843d017e0320f0d18bfc398e27ff25592dfb (diff)
downloadbfs-505843eec93696d3fab69e56c34c578c8d032951.tar.xz
xspawn: Fix $PATH resolution on NetBSD 10
Diffstat (limited to 'src')
-rw-r--r--src/xspawn.c4
1 files 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);