summary refs log tree commit diff
path: root/Src/pattern.c
diff options
context:
space:
mode:
authorPeter Stephenson <p.stephenson@samsung.com>2018-04-20 11:17:06 +0100
committerPeter Stephenson <p.stephenson@samsung.com>2018-05-01 10:27:35 +0100
commitfaf0035e532cde45528806e7a05ad28a0ab7c0fb (patch)
treeae0a89cf5af4394adbb625351056bf14fffe486a /Src/pattern.c
parent11dbc95962897ba5aff905cda2d55d064f52e3a9 (diff)
downloadzsh-faf0035e532cde45528806e7a05ad28a0ab7c0fb.tar.gz
zsh-faf0035e532cde45528806e7a05ad28a0ab7c0fb.tar.xz
zsh-faf0035e532cde45528806e7a05ad28a0ab7c0fb.zip
unposted (branch fork_early): Fork early for pipelines.
If executing a command not at the end of a pipeline, and
not optimised in the calling code, we can fork before
"prefork" substitutions, at the same point as
for background commands.

Move fork before our preliminary scan of arguments to find
a command: in the cases of early fork
we don't need this information before forking.

Ensure we _exit if forked in execcmd_exec().

Rationalise use of forks and pipes.

Ensure we _exit instead of returning from execcmd_exec() if we
have forked.  Before the optimisation code after the fork always ran
to the check at the end, but that code is overkill for the logic
between the early fork and the existing one.

Remove old workaround to fork in caller of execcmd for current shell
constructs as no longer needed with early fork below.

Close input of newly created pipe on fork (destined for RHS of pipe
which we never execute): this replaces a workaround from
zsh-workers/32171, commit 9887fc3d7b.

Set last1 on early fork as needed by some instances of shell
constructs on LHS of pipeline to know they are exiting.
Diffstat (limited to 'Src/pattern.c')
0 files changed, 0 insertions, 0 deletions