diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/exec.c | 4 | ||||
-rw-r--r-- | Src/init.c | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Src/exec.c b/Src/exec.c index 99c7eaa6a..df915e152 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -3123,7 +3123,7 @@ execcmd(Estate state, int input, int output, int how, int last1) int fd = fn->fd2; if(fd == -2) fd = (fn->type == REDIR_MERGEOUT) ? coprocout : coprocin; - fil = dup(fd); + fil = movefd(dup(fd)); } if (fil == -1) { char fdstr[4]; @@ -3151,7 +3151,7 @@ execcmd(Estate state, int input, int output, int how, int last1) else fil = clobber_open(fn); if(fil != -1 && IS_ERROR_REDIR(fn->type)) - dfil = dup(fil); + dfil = movefd(dup(fil)); else dfil = 0; if (fil == -1 || dfil == -1) { diff --git a/Src/init.c b/Src/init.c index 01a969df4..7032ff8ae 100644 --- a/Src/init.c +++ b/Src/init.c @@ -1584,6 +1584,7 @@ zsh_main(UNUSED(int argc), char **argv) fdtable_size = zopenmax(); fdtable = zshcalloc(fdtable_size*sizeof(*fdtable)); + fdtable[0] = fdtable[1] = fdtable[2] = FDT_EXTERNAL; createoptiontable(); emulate(zsh_name, 1, &emulation, opts); /* initialises most options */ |