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

Re: PATCH: Re: PATCH: no more fd mixups



Bart Schaefer wrote:
>Here's a tweak to Zefram's patch to really limit the descriptors to those
>in use by the shell.  The substantive change is only to throw in the test
>that the descriptor is in the fdtable[] array,

OK.  One issue: coprocess file descriptors.  Should they (a) be
passed on to child processes, and (b) be dupable by number?  I think
they should be completely private (accessible obly via >&p and <&p),
but more importantly the answers for (a) and (b) should be the same.
At the moment, coprocess fds do not get passed on to children, but they
are explicitly marked as public in fdtable[], and hence after your patch
they are dupable by number.

I *think* all that needs to change is to remove the line

	fdtable[coprocin] = fdtable[coprocout] = 0;

from exec.c (where the coprocess is being opened), but I don't completely
follow the use of fdtable[], so I'll leave it to someone with more time
on their hands.

-zefram



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