From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [BUG] process substitution breaks when nested or traverses a function
Date: Tue, 24 Apr 2018 10:30:16 +0000 [thread overview]
Message-ID: <1524565816.2838053.1348774976.23F51BA1@webmail.messagingengine.com> (raw)
In-Reply-To: <20180424104335.24dfe68e@camnpupstephen.cam.scsc.local>
Peter Stephenson wrote on Tue, 24 Apr 2018 10:43 +0100:
> On Sat, 21 Apr 2018 06:35:23 -0300
> Francisco de Zuviría Allende <franciscodezuviria@gmail.com> wrote:
> > #!/bin/zsh
> > foo() { cat <(cat "$@"); }; foo <(echo bar);
> > cat: /proc/self/fd/11: No such file or directory
>
> Files and file descriptors for process substitution are handled
> specially, so shouldn't be tidied up by closem(), which is called on the
> inner process substitution (that's why both were required for this to
> show up).
>
> Is there a better way of doing this; or is this patch overkill, or not
> careful enough...? If we don't have /proc/self, tidying up is done only
> with the job filelist, so there wouldn't be a problem. But the get out
> "all" argument looks like a reasonable safety compromise.
I don't know about "better", but I'd looked into this and wondered why
getproc() had two compile-time alternative implementations, one with
mkfifo() and one with /proc/self. Is this just about portability, or...?
> @@ -4352,12 +4352,17 @@ fixfds(int *save)
> /**/
> mod_export void
> -closem(int how)
> +closem(int how, int all)
Maybe add the new parameter 'all' to the docstring?
Cheers,
Daniel
next prev parent reply other threads:[~2018-04-24 10:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20180421093602epcas1p4c7f4182661b42fa2e477f8fe61a3e132@epcas1p4.samsung.com>
2018-04-21 9:35 ` Francisco de Zuviría Allende
2018-04-24 9:43 ` Peter Stephenson
2018-04-24 10:30 ` Daniel Shahaf [this message]
2018-04-24 10:47 ` Peter Stephenson
2018-04-24 11:09 ` Martijn Dekker
2018-04-24 12:29 ` Peter Stephenson
2018-06-17 3:14 ` Francisco de Zuviría Allende
2018-06-18 9:28 ` Peter Stephenson
2018-06-27 9:04 ` Francisco de Zuviría Allende
2018-06-27 9:14 ` Francisco de Zuviría Allende
2018-06-27 9:18 ` Francisco de Zuviría Allende
2018-06-28 18:37 ` Daniel Tameling
2018-06-29 8:37 ` Peter Stephenson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1524565816.2838053.1348774976.23F51BA1@webmail.messagingengine.com \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).