about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <p.w.stephenson@ntlworld.com>2016-09-25 17:14:24 +0100
committerPeter Stephenson <p.w.stephenson@ntlworld.com>2016-09-25 17:14:24 +0100
commit759e5912fdb783e70b3e0d50fa0bc63e441a848b (patch)
treeb69cda73037f2356711a00ca86ef44890c48a643
parent0f8725beeb6b1273a5064f20ed0dd2c160c2a564 (diff)
downloadzsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.tar.gz
zsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.tar.xz
zsh-759e5912fdb783e70b3e0d50fa0bc63e441a848b.zip
39435: Further fix for pgrp of funny pipelines.
Don't set gleader of SUBJOB at the point of creation if the
SUPERJOB has no processes yet.
-rw-r--r--ChangeLog5
-rw-r--r--Src/exec.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index c43272ecf..967c63170 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-25  Peter Stephenson  <p.w.stephenson@ntlworld.com>
+
+	* 39435: Src/exec.c: Don't set gleader of SUBJOB immediately if
+	SUPERJOB has no processes.
+
 2016-09-24  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
 	* 39423: Completion/Zsh/Command/_zed: Support the '--'
diff --git a/Src/exec.c b/Src/exec.c
index d924148d6..a5086c33c 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -1703,7 +1703,8 @@ execpline(Estate state, wordcode slcode, int how, int last1)
 			    jobtab[list_pipe_job].stat |= STAT_SUPERJOB;
 			    jn->stat |= STAT_SUBJOB | STAT_NOPRINT;
 			    jn->other = pid;
-			    jn->gleader = jobtab[list_pipe_job].gleader;
+			    if (hasprocs(list_pipe_job))
+				jn->gleader = jobtab[list_pipe_job].gleader;
 			}
 			if ((list_pipe || last1) && hasprocs(list_pipe_job))
 			    killpg(jobtab[list_pipe_job].gleader, SIGSTOP);