about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c4
-rw-r--r--Src/lex.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/Src/exec.c b/Src/exec.c
index ed77497d3..0670148c7 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -877,8 +877,10 @@ execpline(Sublist l, int how, int last1)
     if (how & Z_ASYNC) {
 	lastwj = newjob;
 	jobtab[thisjob].stat |= STAT_NOSTTY;
-	if (l->flags & PFLAG_COPROC)
+	if (l->flags & PFLAG_COPROC) {
 	    zclose(ipipe[1]);
+	    zclose(opipe[0]);
+	}
 	if (how & Z_DISOWN) {
 	    deletejob(jobtab + thisjob);
 	    thisjob = -1;
diff --git a/Src/lex.c b/Src/lex.c
index 069f9b39b..d88e57c22 100644
--- a/Src/lex.c
+++ b/Src/lex.c
@@ -642,6 +642,7 @@ gettok(void)
 	    }
 	    hungetc(d);
 	    lexstop = 0;
+	    tokfd = -1;
 	    return AMPOUTANG;
 	}
 	hungetc(d);