Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: xtrace output sets ERRNO to 9 (EBADF)
- X-seq: zsh-workers 51169
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: xtrace output sets ERRNO to 9 (EBADF)
- Date: Sat, 10 Dec 2022 11:38:13 +0000
- Archived-at: <https://zsh.org/workers/51169>
- Feedback-id: i425e4195:Fastmail
- In-reply-to: <CAH+w=7bpxyzFYM-sst2D5CYWHHh5R6oggfPH5n5Pcxyq=9ShmQ@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <20221209141047.oyv3jsdvo5s3z6m6@chazelas.org> <CAH+w=7bpxyzFYM-sst2D5CYWHHh5R6oggfPH5n5Pcxyq=9ShmQ@mail.gmail.com>
Bart Schaefer wrote on Fri, Dec 09, 2022 at 18:57:37 -0800:
> diff --git a/Src/exec.c b/Src/exec.c
> index 1810fca5e..a1059af5e 100644
> --- a/Src/exec.c
> +++ b/Src/exec.c
> @@ -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;
This ignores any errors from the fileno() and fclose() calls as well, though?
> }
>
> zsfree(STTYval);
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author