summaryrefslogtreecommitdiff
path: root/execute_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2022-12-13 12:43:50 -0500
committerChet Ramey <chet.ramey@case.edu>2022-12-13 12:43:50 -0500
commitec8113b9861375e4e17b3307372569d429dec814 (patch)
treeeda6c9c211d8db4f1ec80d1ec4095d5d96abfe5a /execute_cmd.c
parent6647917a43dd987c5564cc20d0943213b39e748b (diff)
downloadbash-ec8113b9861375e4e17b3307372569d429dec814.tar.gz
Bash-5.2 patch 15: fix too-aggressive optimizing forks out of subshell commandsHEADmaster
Diffstat (limited to 'execute_cmd.c')
-rw-r--r--execute_cmd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index ee0ea8c4..41d3cf88 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -1654,7 +1654,8 @@ execute_in_subshell (command, asynchronous, pipe_in, pipe_out, fds_to_close)
subshell sets an exit trap, so we set CMD_NO_FORK for simple commands
and set CMD_TRY_OPTIMIZING for simple commands on the right side of an
and-or or `;' list to test for optimizing forks when they are executed. */
- if (user_subshell && command->type == cm_subshell)
+ if (user_subshell && command->type == cm_subshell &&
+ (command->flags & (CMD_TIME_PIPELINE|CMD_INVERT_RETURN)) == 0)
optimize_subshell_command (command->value.Subshell->command);
/* Do redirections, then dispose of them before recursive call. */