From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14731 invoked by alias); 24 Apr 2018 10:38:25 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 42709 Received: (qmail 23939 invoked by uid 1010); 24 Apr 2018 10:38:25 -0000 X-Qmail-Scanner-Diagnostics: from out3-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.27):SA:0(-2.6/5.0):. Processed in 1.671468 secs); 24 Apr 2018 10:38:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | 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 == X-ME-Sender: Message-Id: <1524565816.2838053.1348774976.23F51BA1@webmail.messagingengine.com> From: Daniel Shahaf To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-Mailer: MessagingEngine.com Webmail Interface - ajax-f3006b89 References: <20180424104335.24dfe68e@camnpupstephen.cam.scsc.local> Subject: Re: [BUG] process substitution breaks when nested or traverses a function Date: Tue, 24 Apr 2018 10:30:16 +0000 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=C3=ADa Allende wrote: > > #!/bin/zsh > > foo() { cat <(cat "$@"); }; foo <(echo bar); > > cat: /proc/self/fd/11: No such file or directory >=20 > 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). >=20 > 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