summaryrefslogtreecommitdiffstats
path: root/parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse.c')
-rw-r--r--parse.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/parse.c b/parse.c
index 9054af7..1fc4832 100644
--- a/parse.c
+++ b/parse.c
@@ -1105,13 +1105,17 @@ static struct expr *parse_exec(struct parser_state *state, int flags, int arg2)
expr->cost = 1000000.0;
}
+ int ephemeral_fds = 2;
if (execbuf->flags & BFS_EXEC_CHDIR) {
if (execbuf->flags & BFS_EXEC_MULTI) {
++cmdline->persistent_fds;
- } else if (cmdline->ephemeral_fds < 1) {
- cmdline->ephemeral_fds = 1;
+ } else {
+ ++ephemeral_fds;
}
}
+ if (cmdline->ephemeral_fds < ephemeral_fds) {
+ cmdline->ephemeral_fds = ephemeral_fds;
+ }
return expr;
}