about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-02-02 08:30:45 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-02-02 08:30:45 +0000
commitc931efdf3c59049726f99f4cf056932a7a69ca02 (patch)
tree049db766feb3ef978863ba321fc48db23dcdb8f5 /Src
parent7ae7e4948a54c7043627f18827e2687203a1428d (diff)
downloadzsh-c931efdf3c59049726f99f4cf056932a7a69ca02.tar.gz
zsh-c931efdf3c59049726f99f4cf056932a7a69ca02.tar.xz
zsh-c931efdf3c59049726f99f4cf056932a7a69ca02.zip
zsh-workers/9521
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/Src/exec.c b/Src/exec.c
index 82ddf3edd..a793dc478 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -932,6 +932,7 @@ execpline(Estate state, wordcode slcode, int how, int last1)
     } else {
 	if (newjob != lastwj) {
 	    Job jn = jobtab + newjob;
+	    int updated;
 
 	    if (newjob == list_pipe_job && list_pipe_child)
 		_exit(0);
@@ -980,12 +981,18 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 		    jn->stat |= STAT_NOPRINT;
 		    makerunning(jn);
 		}
-		if (!(jn->stat & STAT_LOCKED))
-		    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 (!(jn->stat & STAT_LOCKED)) {
+		    updated = !!jobtab[thisjob].procs;
+		    waitjobs();
+		    child_block();
+		} else
+		    updated = 0;
+		if (!updated &&
+		    list_pipe_job && jobtab[list_pipe_job].procs &&
+		    !(jobtab[list_pipe_job].stat & STAT_STOPPED)) {
+		    child_unblock();
+		    child_block();
+		}
 		if (list_pipe_child &&
 		    jn->stat & STAT_DONE &&
 		    lastval2 & 0200)