From 9887fc3d7b4508bb21e419a8ce12be9c1ba37e4b Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Fri, 20 Dec 2013 23:03:46 -0800 Subject: 32171: close pipe descriptor in parent when left side is a shell construct to prevent deadlock Also clean up ChangeLog entry that attributed 32119 to 32114 --- Src/exec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Src') diff --git a/Src/exec.c b/Src/exec.c index dccdc2b0d..44800339f 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1691,6 +1691,7 @@ execpline2(Estate state, wordcode pcode, execcmd(state, input, output, how, last1 ? 1 : 2); else { int old_list_pipe = list_pipe; + int subsh_close = -1; Wordcode next = state->pc + (*state->pc), pc; wordcode code; @@ -1738,6 +1739,7 @@ execpline2(Estate state, wordcode pcode, } else { /* otherwise just do the pipeline normally. */ addfilelist(NULL, pipes[0]); + subsh_close = pipes[0]; execcmd(state, input, pipes[1], how, 0); } zclose(pipes[1]); @@ -1750,6 +1752,8 @@ execpline2(Estate state, wordcode pcode, execpline2(state, *state->pc++, how, pipes[0], output, last1); list_pipe = old_list_pipe; cmdpop(); + if (subsh_close != pipes[0]) + zclose(pipes[0]); } } -- cgit 1.4.1