about summary refs log tree commit diff
path: root/Src/exec.c
diff options
context:
space:
mode:
authorTanaka Akira <akr@users.sourceforge.net>2000-01-18 12:29:11 +0000
committerTanaka Akira <akr@users.sourceforge.net>2000-01-18 12:29:11 +0000
commitd473a667b603c83fd6cf921f1942136f4e45ff04 (patch)
treee87178ee8750fd0a11de650e529b7f579053aadc /Src/exec.c
parent2c4e618e968ece47dc19559c480b760b480f0693 (diff)
downloadzsh-d473a667b603c83fd6cf921f1942136f4e45ff04.tar.gz
zsh-d473a667b603c83fd6cf921f1942136f4e45ff04.tar.xz
zsh-d473a667b603c83fd6cf921f1942136f4e45ff04.zip
zsh-workers/9345
Diffstat (limited to 'Src/exec.c')
-rw-r--r--Src/exec.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/Src/exec.c b/Src/exec.c
index b076f4af9..c9c895940 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -949,9 +949,10 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 
 		    /* If the super-job contains only the sub-shell, the
 		       sub-shell is the group leader. */
-		    if (!jn->procs->next || lpforked == 2)
+		    if (!jn->procs->next || lpforked == 2) {
 			jn->gleader = list_pipe_pid;
-
+			jn->stat |= STAT_SUBLEADER;
+		    }
 		    for (pn = jobtab[jn->other].procs; pn; pn = pn->next)
 			if (WIFSTOPPED(pn->status))
 			    break;
@@ -971,14 +972,17 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 		    lastwj = -1;
 	    }
 
+	    errbrk_saved = 0;
 	    for (; !nowait;) {
 		if (list_pipe_child) {
 		    jn->stat |= STAT_NOPRINT;
 		    makerunning(jn);
 		}
-		if (!(jn->stat & STAT_LOCKED))
+		if (!(jn->stat & STAT_LOCKED)) {
+		    child_unblock();
+		    child_block();
 		    waitjobs();
-
+		}
 		if (list_pipe_child &&
 		    jn->stat & STAT_DONE &&
 		    lastval2 & 0200)
@@ -1042,6 +1046,10 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 			list_pipe = 0;
 			list_pipe_child = 1;
 			opts[INTERACTIVE] = 0;
+			if (errbrk_saved) {
+			    errflag = prev_errflag;
+			    breaks = prev_breaks;
+			}
 			break;
 		    }
 		}