1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-10-27 16:50:58 +01:00

31919: fix deadlock when a shell builtin with a multio redirection is used on the left side of a pipeline

Make sure stdin/out/err file descriptors are closed for the multio copy
process, which means not re-using those descriptors after they are closed
and marked FDT_UNUSED in fdtable[].  For completeness, initialize their
fdtable[] state to FDT_EXTERNAL.
This commit is contained in:
Barton E. Schaefer 2013-10-27 15:42:00 -07:00
parent 4748eff7d2
commit c98cbe25d2
3 changed files with 15 additions and 7 deletions

View file

@ -1584,6 +1584,7 @@ zsh_main(UNUSED(int argc), char **argv)
fdtable_size = zopenmax();
fdtable = zshcalloc(fdtable_size*sizeof(*fdtable));
fdtable[0] = fdtable[1] = fdtable[2] = FDT_EXTERNAL;
createoptiontable();
emulate(zsh_name, 1, &emulation, opts); /* initialises most options */