Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [BUG] process substitution breaks when nested or traverses a function
- X-seq: zsh-workers 42709
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: Re: [BUG] process substitution breaks when nested or traverses a function
- Date: Tue, 24 Apr 2018 10:30:16 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=ypCQ2D JgUdmX+b/+Zaw00v56D3FixLzciohDmxoqCKA=; b=AUiqNQID5uiUaXBCCCe9Ao WjD6T0CgQ+98GJWOYOuNwuzj/l75FjEBwP9HnJFsADcxCYLWTSseSb4a+z2cYu0H TISOK6/U+KsjFZ4zomCLEyE5na60s2j7Qxat4khg126bTRXDn4UloI8ghf7V3OzI fUUBl7ZhbUw+ltbai3boc/r04p0nqEjfqdW+R8S1jHGDHpSNzEnbvjY9YANzwbfR WPllMdMr133BZ0JwN08NzJfX7IA3DT0Kk0WUqFl8J+Ywy//VKWwGKdZwOtO441tu XGly4GvAZlr5mG7KekjsUZhPxAiYpkVRNiOcM1KiMMD8HJfL1Sus+flV4KwMdWmA ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=ypCQ2D JgUdmX+b/+Zaw00v56D3FixLzciohDmxoqCKA=; b=It/YtWwYUwSFiXf0x6uHnj abEN2khuWh/Z5/wNUhw9M6HENyYpRA+UPWTr+xGB238H4FTKn8wwYpfHTW/pZSjr BbqFejXemE5/y9MJiwbdcPMlClgEUR6G8EAC6D4cqiTzRswJbpFOG+Gwt9T4EPBp g+DJurOnDWVSwxdU1WfA2WroAYC1HDIc2S2j+5r+LCr4n92MhavxzwfRt9VMKk3V /xLQyUv18dcyj+Lva9O7kWpWMaDA/8+t4CIN/98JsTFcH5RKjwQaQlIrBOMhpT7h reKxntIKrlw/pynEomrXx9lkLwAw44W8HpfKGkXhVLW3RLNLDw11sFUvNpl06rHQ ==
- In-reply-to: <20180424104335.24dfe68e@camnpupstephen.cam.scsc.local>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <CGME20180421093602epcas1p4c7f4182661b42fa2e477f8fe61a3e132@epcas1p4.samsung.com> <CA++-COyOYiE_snQeLB_jsDmWAvne9bjS7GWnA28mPNwTeVo0kg@mail.gmail.com> <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@xxxxxxxxx> 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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author