From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 885 invoked by alias); 1 Dec 2009 09:53:11 -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: 27444 Received: (qmail 771 invoked from network); 1 Dec 2009 09:53:08 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,PLING_QUERY, RCVD_IN_DNSWL_LOW autolearn=no version=3.2.5 Received-SPF: none (ns1.primenet.com.au: domain at csr.com does not designate permitted sender hosts) Message-Id: <200912010952.nB19qs51012135@news01.csr.com> X-Authentication-Warning: news01.csr.com: pws owned process doing -bs To: zsh-workers@zsh.org Subject: Re: unable to wait on completed job [was: should $! give the pid of subshell?] In-reply-to: <091130185720.ZM3782@torch.brasslantern.com> References: <19213.26295.345572.732238@gargle.gargle.HOWL> <200911251748.nAPHmrCX010198@news01.csr.com> <091129211436.ZM1769@torch.brasslantern.com> <20091130183707.4f8ea36e@news01> <091130185720.ZM3782@torch.brasslantern.com> Comments: In-reply-to Bart Schaefer message dated "Mon, 30 Nov 2009 18:57:20 -0800." Date: Tue, 01 Dec 2009 09:52:54 +0000 From: Peter Stephenson X-OriginalArrivalTime: 01 Dec 2009 09:52:56.0713 (UTC) FILETIME=[0EFF5790:01CA726C] Content-Type: text/plain MIME-Version: 1.0 X-Scanned-By: MailControl A-09-22-03 (www.mailcontrol.com) on 10.68.0.135 Bart Schaefer wrote: > On Nov 30, 6:37pm, Peter Stephenson wrote: > } > } If it's only an issue for $! (lastpid internally), I think it's fairly > } straightforward to fix. I tried to make it work even if a new process > } with the same PID came along later. > > This looks reasonable, but I wonder if we should make it conditional > on POSIX_JOBS ? I'm not sure what that gains, apart from an extra error message; is there a case where it's important that exited background jobs can't be waited for? I can see one oddity, which is you can wait for it multiple times without an error (and with the same return status); I could fix that but I see bash does the same. -- Peter Stephenson Software Engineer Tel: +44 (0)1223 692070 Cambridge Silicon Radio Limited Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, UK Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom