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

Re: <(...), >(...) and fds above 9



On Mon, 2019-07-01 at 07:39 -0700, Bart Schaefer wrote:
> On Mon, Jul 1, 2019 at 3:09 AM Peter Stephenson
> <p.stephenson@xxxxxxxxxxx> wrote:
> > 
> > 
> > On Mon, 2019-07-01 at 11:00 +0100, Stephane Chazelas wrote:
> > > 
> > > 
> > > It seems fds above 9 are closed in those forms of process substitutions.
> > > 
> > > It doesn't happen for the =(...) form of process substitution.
> > > 
> > > Is that intentional?
> > I'd be surprised if there was any deliberate intention to make these different,
> > but there may be some detail I can't think of.
> <(...) does
> entersubsh(ESUB_ASYNC|ESUB_PGRP, NULL);
> 
> whereas =(...) does
> entersubsh(ESUB_PGRP|ESUB_NOMONITOR, NULL);
> 
> The fds above 9 are only closed for ASYNC, I think.

I don't think entersubsh() calls closem() --- it's
usually done at other points, either in execute()
or a special execution function in the case of the
various process-style substitutions.

Looks like =(...) doesn't call closem() at all when
forking, hence the difference in behaviour.  So
=(...) is the odd one out.

pws



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