Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

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.

I haven't found an example where this fails...

Bye
 Sven

diff -ru ../z.old/Src/exec.c Src/exec.c
--- ../z.old/Src/exec.c	Tue Feb  1 11:33:24 2000
+++ Src/exec.c	Tue Feb  1 11:34:43 2000
@@ -980,9 +980,12 @@
 		    jn->stat |= STAT_NOPRINT;
 		    makerunning(jn);
 		}
-		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();
 		}
 		if (list_pipe_child &&

--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author