Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: xtrace output sets ERRNO to 9 (EBADF)



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