From 759e5912fdb783e70b3e0d50fa0bc63e441a848b Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Sun, 25 Sep 2016 17:14:24 +0100 Subject: 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. --- Src/exec.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Src/exec.c') 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); -- cgit 1.4.1