summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2011-02-17 19:52:41 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2011-02-17 19:52:41 +0000
commit3a23e82941ce3b37b0eb2a1523928097756bc8ad (patch)
treeab2b30660969a8f1bad14ac46e78bdf1301b8424
parent9bfc05e3dba10929cf13dd7628bf8adac7d6345a (diff)
downloadzsh-3a23e82941ce3b37b0eb2a1523928097756bc8ad.tar.gz
zsh-3a23e82941ce3b37b0eb2a1523928097756bc8ad.zip
28762: fix coproc file desriptor closing
-rw-r--r--ChangeLog7
-rw-r--r--Src/exec.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b2d87e6ca..ce8f578de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-17 Peter Stephenson <p.w.stephenson@ntlworld.com>
+
+ * 28762: Src/exec.c: logic for closing coproc file descriptors
+ was wrong.
+
2011-02-15 Frank Terbeck <ft@bewatermyfriend.org>
* 28758: Functions/Misc/colors: work with non-default option sets.
@@ -14207,5 +14212,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5198 $
+* $Revision: 1.5199 $
*****************************************************
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);