From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4063 invoked by alias); 13 Sep 2017 09:55:56 -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: 41695 Received: (qmail 7947 invoked by uid 1010); 13 Sep 2017 09:55:56 -0000 X-Qmail-Scanner-Diagnostics: from mailout1.w1.samsung.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(210.118.77.11):SA:0(-6.9/5.0):. Processed in 1.626543 secs); 13 Sep 2017 09:55:56 -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=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.1 X-Envelope-From: p.stephenson@samsung.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | X-AuditID: cbfec7f4-f79ab6d000003290-c8-59b900a3520a Date: Wed, 13 Sep 2017 10:55:43 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: trap, eval and wait (was: [BUG] exec + builtin and traps) Message-id: <20170913105543.3e6168f7@pwslap01u.europe.root.pri> In-reply-to: <20170912160409.2ff01c0f@pwslap01u.europe.root.pri> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrLIsWRmVeSWpSXmKPExsWy7djPc7qLGXZGGsy5z2FxsPkhkwOjx6qD H5gCGKO4bFJSczLLUov07RK4M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xghZp5kkVi7 /CLYHH4BfYmrfz8xQdxnLzHzyhlGiGZBiR+T74HVMAtoSWze1sQKYctLbF7zlhnEFhJQl7hx dzf7BEbhWUhaZiFpmYWkZQEj8ypGkdTS4tz03GJDveLE3OLSvHS95PzcTYzAYN527OfmHYyX NgYfYhTgYFTi4Q24tT1SiDWxrLgy9xCjBAezkgjvsU87IoV4UxIrq1KL8uOLSnNSiw8xSnOw KInz9u5ZHSkkkJ5YkpqdmlqQWgSTZeLglGpgVNXkYNwXNMta4Xjp/UuSP2fp7/+/2Hn3lUk+ UjKCoTL7n4gzWVl3LJc0qX4em7OlQJArZ2PZ5WdH2aYXdZzeNUHh9tTsnqn76z418miZ2Tnk RNrM2p6xe+Emab4VpjILYpNvlXzP5p4ofFmSz5CXO+9obNGR/WInA8VeXXnVaPH7QobZR4E5 SizFGYmGWsxFxYkA9N1iw2ICAAA= X-CMS-MailID: 20170913095546eucas1p16a4767f5a2d8c1fb364396337ad0a421 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUb?= =?UTF-8?B?7IK87ISx7KCE7J6QG1ByaW5jaXBhbCBFbmdpbmVlciwgU29mdHdhcmU=?= X-Global-Sender: =?UTF-8?B?UGV0ZXIgU3RlcGhlbnNvbhtTQ1NDLURhdGEgUGxhbmUbU2Ft?= =?UTF-8?B?c3VuZyBFbGVjdHJvbmljcxtQcmluY2lwYWwgRW5naW5lZXIsIFNvZnR3YXJl?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDA1Q0QwNTAwNTg=?= CMS-TYPE: 201P X-CMS-RootMailID: 20170912101045epcas2p4cae7e7df78ef035900f9c6099dc054fb X-RootMTR: 20170912101045epcas2p4cae7e7df78ef035900f9c6099dc054fb References: <20170912100257.GA32535@zira.vinc17.org> <20170912111906.397cffec@pwslap01u.europe.root.pri> <20170912103919.GA1794@zira.vinc17.org> <20170912115006.4d1b964d@pwslap01u.europe.root.pri> <20170912114220.GB1794@zira.vinc17.org> <20170912125139.4f698399@pwslap01u.europe.root.pri> <20170912120237.GA7326@zira.vinc17.org> <20170912131054.4f7c11a5@pwslap01u.europe.root.pri> <20170912142145.GA10597@cventin.lip.ens-lyon.fr> <20170912160409.2ff01c0f@pwslap01u.europe.root.pri> On Tue, 12 Sep 2017 16:04:09 +0100 Peter Stephenson wrote: > Quite possibly any of the above flags should mean wait ignores the job, > but I've taken STAT_NOPRINT as the most logical to test here as it > basically means "user is not interested in this". I've committed this but I'm wondering if it would be sensible to add STAT_DONE here? There's nothing to wait for if the job is done. (This case is only for "wait" without an argument, so just wait for everything we think is outstanding.) By the way, unrelated to the bug (though it works around it), if you're really interested in the status of the last background job, I think you need to use "wait $!" anyway --- otherwise if the job is already finished, "wait" will simply return immediately with status 0. Waiting for $! is the only special case available to handle the race. pws