zsh-users
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh-users@zsh.org
Subject: Re: subprocess
Date: Sat, 06 Jun 2020 20:53:45 +0100	[thread overview]
Message-ID: <864555580040248526b2b7fc6fd036a6ac0e9c05.camel@ntlworld.com> (raw)
In-Reply-To: <CAH+w=7bEco_BFsyzVC+BNHh7W55K7ttSNsKEu0TByXK-eAhyOQ@mail.gmail.com>

On Sat, 2020-06-06 at 11:19 -0700, Bart Schaefer wrote:
> On Fri, Jun 5, 2020 at 6:01 PM Daniel Shahaf <d.s@daniel.shahaf.name> wrote:
> > > On 6/5/20, Pier Paolo Grassi <pierpaolog@gmail.com> wrote:
> > > > efe() cat $1
> > > > efe <(seq 1 10) | wc -l
> > > > cat: /proc/self/fd/13: No such file or directory
>
> A named function on the left side of a pipeline becomes its own "job",
> where all descriptors above 10 are closed.

Itʼs this call here.

How ahout simply reordering so we tidy up after the function is called?
That fixes the problem, hard to see how that can cause a leak...?

pws

diff --git a/Src/exec.c b/Src/exec.c
index 2b8e2167f..53d3aa048 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3969,8 +3969,8 @@ execcmd_exec(Estate state, Execcmd_params eparams,
 
 	    if (is_shfunc) {
 		/* It's a shell function */
-		pipecleanfilelist(filelist, 0);
 		execshfunc((Shfunc) hn, args);
+		pipecleanfilelist(filelist, 0);
 	    } else {
 		/* It's a builtin */
 		LinkList assigns = (LinkList)0;


  reply	other threads:[~2020-06-06 19:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-05  2:03 subprocess Pier Paolo Grassi
2020-06-05 10:25 ` subprocess Mikael Magnusson
2020-06-06  1:00   ` subprocess Daniel Shahaf
2020-06-06 18:19     ` subprocess Bart Schaefer
2020-06-06 19:53       ` Peter Stephenson [this message]
2020-06-08 19:55         ` subprocess Peter Stephenson
2020-06-08 14:22       ` subprocess Pier Paolo Grassi
2020-06-08 21:32         ` subprocess Bart Schaefer

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=864555580040248526b2b7fc6fd036a6ac0e9c05.camel@ntlworld.com \
    --to=p.w.stephenson@ntlworld.com \
    --cc=zsh-users@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).