aboutsummaryrefslogtreecommitdiffstats
path: root/execute_cmd.c
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2011-11-22 20:03:16 -0500
committerChet Ramey <chet.ramey@case.edu>2011-11-22 20:03:16 -0500
commit335de49a7201fae75ba82e551bab361860cc5609 (patch)
tree44b74a87c979bba49dc540571185a551e6fbc8c3 /execute_cmd.c
parentb4d40164691e23c7c546daa57c411907a2c2e8cf (diff)
downloadandroid_external_bash-335de49a7201fae75ba82e551bab361860cc5609.tar.gz
android_external_bash-335de49a7201fae75ba82e551bab361860cc5609.tar.bz2
android_external_bash-335de49a7201fae75ba82e551bab361860cc5609.zip
Bash-4.2 patch 18
Diffstat (limited to 'execute_cmd.c')
-rw-r--r--execute_cmd.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index 485b0c7..30b0460 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -2196,6 +2196,7 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
if (ignore_return && cmd)
cmd->flags |= CMD_IGNORE_RETURN;
+#if defined (JOB_CONTROL)
lastpipe_flag = 0;
begin_unwind_frame ("lastpipe-exec");
lstdin = -1;
@@ -2215,15 +2216,19 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
lastpipe_jid = stop_pipeline (0, (COMMAND *)NULL); /* XXX */
add_unwind_protect (lastpipe_cleanup, lastpipe_jid);
}
- cmd->flags |= CMD_LASTPIPE;
+ if (cmd)
+ cmd->flags |= CMD_LASTPIPE;
}
if (prev >= 0)
add_unwind_protect (close, prev);
+#endif
exec_result = execute_command_internal (cmd, asynchronous, prev, pipe_out, fds_to_close);
+#if defined (JOB_CONTROL)
if (lstdin > 0)
restore_stdin (lstdin);
+#endif
if (prev >= 0)
close (prev);