1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-05-21 12:01:54 +02:00

51161: correct errno after closing xtrace FD

This commit is contained in:
Bart Schaefer 2022-12-09 19:30:35 -08:00
parent 72540a758a
commit 2028539cb1
2 changed files with 5 additions and 0 deletions

View file

@ -1,5 +1,7 @@
2022-12-09 Bart Schaefer <schaefer@zsh.org>
* 51161: Src/exec.c: correct errno after closing xtrace FD
* Shohei YOSHIDA: 51111: Completion/Unix/Command/_global:
update completion for global to version 6.6.8

View file

@ -4336,10 +4336,13 @@ execcmd_exec(Estate state, Execcmd_params eparams,
}
}
if (newxtrerr) {
int eno = errno;
fil = fileno(newxtrerr);
fclose(newxtrerr);
xtrerr = oxtrerr;
/* Call zclose() to clean up internal tables, ignore EBADF */
zclose(fil);
errno = eno;
}
zsfree(STTYval);