From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1889 invoked from network); 1 Feb 2000 16:35:38 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 1 Feb 2000 16:35:38 -0000 Received: (qmail 6534 invoked by alias); 1 Feb 2000 16:35:33 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9511 Received: (qmail 6522 invoked from network); 1 Feb 2000 16:35:31 -0000 From: "Bart Schaefer" Message-Id: <1000201163521.ZM6426@candle.brasslantern.com> Date: Tue, 1 Feb 2000 16:35:21 +0000 In-Reply-To: <200002011058.LAA07413@beta.informatik.hu-berlin.de> Comments: In reply to Sven Wischnowsky "Re: PATCH: job-control" (Feb 1, 11:58am) References: <200002011058.LAA07413@beta.informatik.hu-berlin.de> X-Mailer: Z-Mail (5.0.0 30July97) To: Sven Wischnowsky , zsh-workers@sunsite.auc.dk Subject: Re: PATCH: job-control MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Feb 1, 11:58am, Sven Wischnowsky wrote: } Subject: Re: PATCH: job-control } } } I wrote: } } > But removing those two child_* and } > adding: } > } > if (list_pipe_job && jobtab[list_pipe_job].procs && } > !(jobtab[list_pipe_job].stat & STAT_STOPPED)) } > child_suspend(0); } > } > before the if (!list_pipe_child && ...) fixes the problem, too and is } > almost certainly better. Can anyone see a problem with this? } } No, we would also need a child_block, then, so we can use } child_unblock()/child_block() after this test. Waitaminute, now I'm *really* confused. } - if (!(jn->stat & STAT_LOCKED)) { } - child_unblock(); } + if (!(jn->stat & STAT_LOCKED)) } waitjobs(); } + } + if (list_pipe_job && jobtab[list_pipe_job].procs && } + !(jobtab[list_pipe_job].stat & STAT_STOPPED)) { } + child_unblock(); } child_block(); } } So now you're saying it works to do the child_unblock() *after* the waitjobs() rather than before? That makes no sense; waitjobs() does a child_unblock() at the end. So if the previous child_unblock() (inside the !STAT_LOCKED test) worked, then waitjobs() was getting called, and this child_unblock() shouldn't make any difference. Unless this one is happening in a different call to execpline()? Does the patch below work too? In any case, that last child_block() above should be outside the close brace. Index: Src/exec.c =================================================================== @@ -981,13 +981,11 @@ makerunning(jn); } if (!(jn->stat & STAT_LOCKED)) - waitjobs(); - - if (list_pipe_job && jobtab[list_pipe_job].procs && - !(jobtab[list_pipe_job].stat & STAT_STOPPED)) { - child_unblock(); - child_block(); - } + waitjobs(); /* Implicit child_unblock() */ + else if (list_pipe_job && jobtab[list_pipe_job].procs && + !(jobtab[list_pipe_job].stat & STAT_STOPPED)) + child_unblock(); /* Permit job table update */ + child_block(); /* Freeze job table again */ if (list_pipe_child && jn->stat & STAT_DONE && lastval2 & 0200) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com