From c98cbe25d2be2c8c552250e7e039a72e1f61887b Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Sun, 27 Oct 2013 15:42:00 -0700 Subject: 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. --- Src/init.c | 1 + 1 file changed, 1 insertion(+) (limited to 'Src/init.c') diff --git a/Src/init.c b/Src/init.c index 01a969df4..7032ff8ae 100644 --- a/Src/init.c +++ b/Src/init.c @@ -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 */ -- cgit v1.2.3