From 2b1deb0aee9bfe22f885e3e20c8636e49c01dd21 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sun, 10 Oct 1999 16:40:54 +0000 Subject: zsh-workers/8189 --- Src/exec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index 6d504e52d..7993af2da 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1906,9 +1906,9 @@ execcmd(Cmd cmd, int input, int output, int how, int last1) break; case MERGEIN: case MERGEOUT: - if(fn->fd2 < 10) + if (fn->fd2 < 10) closemn(mfds, fn->fd2); - if(fn->fd2 > 9) { + if (fn->fd2 > 9 && fdtable[fn->fd2]) { fil = -1; errno = EBADF; } else { @@ -1922,7 +1922,7 @@ execcmd(Cmd cmd, int input, int output, int how, int last1) closemnodes(mfds); fixfds(save); - if(fn->fd2 != -2) + if (fn->fd2 != -2) sprintf(fdstr, "%d", fn->fd2); zerr("%s: %e", fn->fd2 == -2 ? "coprocess" : fdstr, errno); execerr(); -- cgit 1.4.1