summaryrefslogtreecommitdiffstats
path: root/src/exec.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-11-15 09:21:53 -0500
committerTavian Barnes <tavianator@tavianator.com>2023-11-15 09:21:53 -0500
commit8b312eb6553235c36f5483d4e46c5034dcc03ce2 (patch)
treee50343acd34d92cfb146068a78624568ab903a6e /src/exec.c
parentcc7d66416b91e0972c1022d0a835804a63ab7ab1 (diff)
downloadbfs-8b312eb6553235c36f5483d4e46c5034dcc03ce2.tar.xz
xspawn: API tweaks
Diffstat (limited to 'src/exec.c')
-rw-r--r--src/exec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/exec.c b/src/exec.c
index 87250ac..3ff6f92 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -362,9 +362,7 @@ static int bfs_exec_spawn(const struct bfs_exec *execbuf) {
return -1;
}
- if (bfs_spawn_setflags(&spawn, BFS_SPAWN_USE_PATH) != 0) {
- goto fail;
- }
+ spawn.flags |= BFS_SPAWN_USE_PATH;
if (execbuf->wd_fd >= 0) {
if (bfs_spawn_addfchdir(&spawn, execbuf->wd_fd) != 0) {
@@ -374,7 +372,7 @@ static int bfs_exec_spawn(const struct bfs_exec *execbuf) {
// Reset RLIMIT_NOFILE if necessary, to avoid breaking applications that use select()
if (rlim_cmp(ctx->orig_nofile.rlim_cur, ctx->cur_nofile.rlim_cur) < 0) {
- if (bfs_spawn_addsetrlimit(&spawn, RLIMIT_NOFILE, &ctx->orig_nofile) != 0) {
+ if (bfs_spawn_setrlimit(&spawn, RLIMIT_NOFILE, &ctx->orig_nofile) != 0) {
goto fail;
}
}