From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19981 invoked by alias); 23 Jul 2016 17:02:03 -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: X-Seq: 38923 Received: (qmail 15856 invoked from network); 23 Jul 2016 17:02:03 -0000 X-Qmail-Scanner-Diagnostics: from mail-pa0-f67.google.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(209.85.220.67):SA:0(0.0/5.0):. Processed in 0.128452 secs); 23 Jul 2016 17:02:03 -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=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=6ivyZoBx2oQs95DqeiSO0hSTQ4ifjtMHtBPN8MRCRIk=; b=xZWM+yg58/HDu+0YqKoKXSKbhOFcGHdKCCAi2ZWNpZf9ZuiXK9JX0bmP7PeKQQ9nff MtztnOMDYBmvL2HR0LZBTbE/M/aU2S0XIYRlIsNhBKzQRnNeHi6EYYGeuGFu+uFGlNXR PGDwIrdJOIGfo9uS4jwxQdCxrFaXWyG02qQgYPa9y3qscfAXnQgwyyZafggFUTPBvRKo jCCbiETnSqss3RuYa57lfYftbKuTlTFm9UvWb/NdJ659p8EcJthdI3GdZmNT5YHGUDD/ Bk0kWHHtWUWEncCAKH4yOLGexlcQZyfzJsn+Hwp4YrA0iCzVz4ptccTlAZA1xDmpx6oN vZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=6ivyZoBx2oQs95DqeiSO0hSTQ4ifjtMHtBPN8MRCRIk=; b=hsH8z+SvnN2w5RCLKfBrt8xSHOO16QNLt7Zuw/HnGvj0elf6A+rc8Czn+M+irT/D8T tIbrnkRz2B2LCKTWMGSISL2hybmK6x/SUHR20Z7kQfapjT4GwCBHizjHvz/5JBJe3nJI sdOi4dkwXgyhu48pTn3Up+Oe1JSb1hGn0ksm5qIYeRD0b06VZ8l9HziMno6kIWZqVzP3 AObUE3whif13ZZpxJ9I1nOSIQ6vjlgVBU0YZ/J8IRUrXuYPjiitNdDCNE6A/PdyLqGI7 Q/0hdfqjTzsSGkRil8RAvZlULTdHokwF3vkT6IhGVBU02IjtZrPpDrQIkJMPAPWjcT9E RIwA== X-Gm-Message-State: AEkooutY4ssVN0MsLAivJs2ILHW3DfYgQc7QPC9uvKFFOcD0mAPm997BX+EuabEX1vfYww== X-Received: by 10.66.182.232 with SMTP id eh8mr16217790pac.146.1469293315134; Sat, 23 Jul 2016 10:01:55 -0700 (PDT) From: Bart Schaefer Message-Id: <160723100235.ZM18912@torch.brasslantern.com> Date: Sat, 23 Jul 2016 10:02:35 -0700 In-Reply-To: <160720204047.ZM27592@torch.brasslantern.com> Comments: In reply to Bart Schaefer "Re: use of "less" in function and interrupt" (Jul 20, 8:40pm) References: <20160720113633.GA17431@zira.vinc17.org> <20160720132113.1d70a4c0@pwslap01u.europe.root.pri> <160720204047.ZM27592@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Re: use of "less" in function and interrupt MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Jul 20, 8:40pm, Bart Schaefer wrote: } } Probably there's some point where the one last wait is needed, within } the cleanup of jobs in the current shell, to make sure that all the } subjobs really did go away. I suspect this to be related to the } breakup of errflag into ERRFLAG_ERROR and ERRFLAG_INT. Indeed the following seems to fix it. All tests still pass and the several interactive cases I tried appear to do the right thing, but I'm not sure there isn't some edge case I've missed. For example, perhaps we should be saving and restoring errflag around the call to signal_suspend() so that it can't be cleared by trap handlers? I call attention to the comments from Oberon and PWS just a few lines below the context of this diff. diff --git a/Src/jobs.c b/Src/jobs.c index 3db2ed0..ce8535d 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -1472,7 +1472,7 @@ zwaitjob(int job, int wait_cmd) */ pipecleanfilelist(jn->filelist, 0); } - while (!errflag && jn->stat && + while (!(errflag & ERRFLAG_ERROR) && jn->stat && !(jn->stat & STAT_DONE) && !(interact && (jn->stat & STAT_STOPPED))) { signal_suspend(SIGCHLD, wait_cmd);