From 3a23e82941ce3b37b0eb2a1523928097756bc8ad Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Thu, 17 Feb 2011 19:52:41 +0000 Subject: 28762: fix coproc file desriptor closing --- Src/exec.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 4576fc031..11d37f1b3 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3218,10 +3218,14 @@ execcmd(Estate state, int input, int output, int how, int last1) _exit(1); } closem(FDT_INTERNAL); - if (coprocin) + if (coprocin != -1) { zclose(coprocin); - if (coprocout) + coprocin = -1; + } + if (coprocout != -1) { zclose(coprocout); + coprocout = -1; + } #ifdef HAVE_GETRLIMIT if (!forked) setlimits(NULL); -- cgit 1.4.1