diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2017-11-12 13:11:58 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2017-11-12 15:17:46 -0500 |
commit | 622bcf9d46a763b7aaba75fa8421533bcbe4b981 (patch) | |
tree | b1e7bfe8f1a108f13a1bd6d8bf03c2d852a1ce09 /parse.c | |
parent | af7878c7474de2f6c5542ad52a0a67237387c638 (diff) | |
download | bfs-622bcf9d46a763b7aaba75fa8421533bcbe4b981.tar.xz |
exec: Recover from E2BIG
Diffstat (limited to 'parse.c')
-rw-r--r-- | parse.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |