From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28661 invoked by alias); 25 Sep 2016 14:45: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: 39434 Received: (qmail 5511 invoked from network); 25 Sep 2016 14:45:03 -0000 X-Qmail-Scanner-Diagnostics: from know-smtprelay-omc-3.server.virginmedia.net 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(80.0.253.67):SA:0(-0.0/5.0):. Processed in 0.464494 secs); 25 Sep 2016 14:45: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=SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: p.w.stephenson@ntlworld.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _smtprelay.virginmedia.com designates 80.0.253.67 as permitted sender) X-Originating-IP: [86.21.219.59] X-Spam: 0 X-Authority: v=2.1 cv=W9TFLkik c=1 sm=1 tr=0 a=utowdAHh8RITBM/6U1BPxA==:117 a=utowdAHh8RITBM/6U1BPxA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=q2GGsy2AAAAA:8 a=U_CTSGzZLqoyyoZKYVYA:9 a=CjuIK1q_8ugA:10 a=z9dJwno5l634igLiVhy-:22 Date: Sun, 25 Sep 2016 15:39:24 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Bug related to stdin/always/jobcontrol Message-ID: <20160925153924.7e741ffc@ntlworld.com> In-Reply-To: <160922181847.ZM22524@torch.brasslantern.com> References: <87r392jgd0.fsf@juno.home.vuxu.org> <20160905164207.4630643b@pwslap01u.europe.root.pri> <20160914183105.69862fa9@pwslap01u.europe.root.pri> <20160914223553.3173c8ca@ntlworld.com> <20160922115921.GA3613@fujitsu.shahaf.local2> <160922093838.ZM7266@torch.brasslantern.com> <160922181847.ZM22524@torch.brasslantern.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 22 Sep 2016 18:18:47 -0700 Bart Schaefer wrote: > However, in attempting to figure it out, I found some sixteen-year-old > code that is clearly wrong: > > diff --git a/Src/exec.c b/Src/exec.c > index d924148..bf97b5c 100644 > --- a/Src/exec.c > +++ b/Src/exec.c > @@ -1702,7 +1702,7 @@ execpline(Estate state, wordcode slcode, int how, int last1) > jobtab[list_pipe_job].other = newjob; > jobtab[list_pipe_job].stat |= STAT_SUPERJOB; > jn->stat |= STAT_SUBJOB | STAT_NOPRINT; > - jn->other = pid; > + jn->other = list_pipe_job; > jn->gleader = jobtab[list_pipe_job].gleader; > } > if ((list_pipe || last1) && hasprocs(list_pipe_job)) > > jn->other is a job table index, not a process ID. The code's correct as it stands (modulo problems setting the values it's using) --- read my previous explanations and the updated comment in zsh.h about "other" which now explicitly states this is a pid if the job is a SUBJOB. "other" could perhaps be a union to indicate this. pws