| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
These are descriptors marked FDT_EXTERNAL.
Make all sysopen'ed file descriptors FDT_EXTERNAL.
Make =(...) call closem() consistent with other substitutions.
Document file descriptors are left open.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
Combine logic for case after committed to exit (shell_exiting) with
case where exit occurred in a function we nee to unwind (exit_pending).
Add sarky note for future generations to be confused at.
|
|
|
|
|
| |
Silences a compiler warning (write(2) is declared with warn_unused_result
in current Debian Unstable).
|
|
|
|
|
|
|
|
|
| |
If list_pipe_job triggered more than once we need to know
the most recent process group leader, so record that
both if the attach happened in the main shell on in
entersubsh().
Also don't pass back proocess group for ESUB_ASYNC subshells.
|
|
|
|
|
| |
Fix additional races by passing back use of list_pipe_job
from subshell.
|
|
|
|
|
|
|
|
|
| |
A newly forked subshell now reports back the process group it
will be using for the main shell to record.
This prevents an error where the shell incorrectly thought an
exiting process owned the terminal and so grabbed it back,
putting the foreground process into the background.
|
|
|
|
|
|
| |
See NEWS for more information.
Patch by Anthony Sottile and Buck Evan.
|
|
|
|
| |
The point can now increment twice per iteration.
|
|
|
|
|
|
|
|
|
|
| |
Fix regression with trap on left hand side of pipe.
Fix forced return from shell structure within nested function.
Fix tests exiting too early.
Add new test case.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Don't close associated file descriptors in the closem()
tidy up function as they should remain visible to external
processes. Override if about to exit.
Unit test for the failing case: note this relies on the
existence of /proc/self/fd or equivalent.
|
|
|
|
|
|
|
| |
In execcmd the case of running the last command in a pipeline
asynchronously for the purpose of & and &! is easy to work out,
and we can avoid side effects and unnecessary execution time in
the parent shell by forking earlier.
|
|
|
|
|
|
|
|
|
| |
If process group leader exits, allow a newly forked process to become
process leader. If a foreground job, reattach the shell to the
terminal until that happens.
Unblock signals when reading output for command subsitution so that
we can do this reattaching immediately.
|
|
|
|
|
| |
This was occurring in a multiple function definition where a
function name is duplicated.
|
| |
|
| |
|
|
|
|
| |
This improves the consistency of error reporting from $(...) constructs.
|
|
|
|
|
| |
Handling of white space in particular was confusing and inconsistent
with other shells.
|
| |
|
|
|
|
|
|
|
|
| |
Functions defined inside other fucntions needs file line number
adding. Particularly useful for anonymous fucntions.
Add flag to indicate a function is anonymous. Done up to now
by comparing the name to a pointer but this is more consistent.
|
|
|
|
|
|
| |
"[n] No" to the RM_STAR_SILENT prompt.
Patch by Stephane, rebased by Mikael.
|
|
|
|
|
|
| |
Needed when comparing word code function name with autoload request.
Add test.
|
|
|
|
|
|
| |
Replaces stack for more efficient memory management.
Also fix debug message when FUNCNEST is increased.
|
|
|
|
| |
Initialised from existing configuration value.
|
|
|
|
|
|
| |
We try to move an fd which isn't opend but it will feel.
This needs handling specially in the new code for marking
saved fd's.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Move detection of key/value pairs down into prefork().
Detect normal array assignment and [key]=val array assignemnt
separately. Mark key / value pairs with Marker and pass up flag. Deal
with marked triads specially later on.
|
| |
|
|
|
|
|
|
|
| |
Works for both normal and typeset case, also var+=...
Still to do: allow to be mixed with straight array assignment,
improve typeset -p, implement [key]+=value.
|
| |
|
|
|
|
|
|
|
| |
There was an exception to the usual ERR_EXIT pattern that causes
problems when executing a function in an else branch. It seems
the exception is no longer needed as the regression tests pass
without it.
|
|
|
|
|
|
|
|
| |
It now operates separately at each function depth.
To keep ERR_EXIT global, make the noerrexit variable usd bit flags.
Extend tests.
|
|
|
|
|
| |
Record fd's that have been saved in fdtable and if the shell
forks close them as they will never be restored.
|
|
|
|
| |
Document the default behaviour and add a test.
|
|
|
|
| |
Heap is usable ever since addfilelist() of workers/31528 (commit 3c573222).
|
|
|
|
| |
This was missing in the case of &,, causing a file descriptor leak.
|
|
|
|
| |
Also add tests for known precommand modifier issues.
|
|
|
|
|
|
| |
Also add check so we don't delay an exit if we were already in
an EXIT trap for the main shell, as we should in that case leave
immediately.
|
| |
|