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

Re: XTRACE output -- I thought we'd fixed this?



On Mon, 16 May 2011 14:28:43 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> Stderr redirection isn't supposed to redirect the xtrace descriptor
> unless you use a { ... } construct.  There's even this in
> exec.c:execcmd():
> 
>     /* Make a copy of stderr for xtrace output before redirecting */
>     fflush(xtrerr);
>     if (isset(XTRACE) && xtrerr == stderr &&
> 	(type < WC_SUBSH || type == WC_TIMED)) {
> 	if ((newxtrerr = fdopen(movefd(dup(fileno(stderr))), "w"))) {
> 	    xtrerr = newxtrerr;
> 	    fdtable[fileno(xtrerr)] = FDT_XTRACE;
> 	}
>     }
> 
> Yet E02xtrace.ztst appears to expect this (wrong?) behavior, so I
> must be mis-remembering something.

I've been very confused by this, so it's quite possible something is
still wrong.

-- 
Peter Stephenson <pws@xxxxxxx>            Software Engineer
Tel: +44 (0)1223 692070                   Cambridge Silicon Radio Limited
Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK


Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom



Messages sorted by: Reverse Date, Date, Thread, Author