about summary refs log tree commit diff
path: root/Src/jobs.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-09-16 09:34:17 +0100
committerPeter Stephenson <pws@zsh.org>2016-09-16 17:23:12 +0100
commit327f3dd3adfc8fdd6c356722d093a340b81190a7 (patch)
tree013049092ef15b18d3dc4c308a3fc9ab7c7b765a /Src/jobs.c
parent01ae64c0d74c17e36bfe6f52394a59754b8e8c92 (diff)
downloadzsh-327f3dd3adfc8fdd6c356722d093a340b81190a7.tar.gz
zsh-327f3dd3adfc8fdd6c356722d093a340b81190a7.tar.xz
zsh-327f3dd3adfc8fdd6c356722d093a340b81190a7.zip
39359: Fix remaining race with orphaned subjob.
When shell is forked to run right hand side of pipieline it should
use its own PID as process group if the left hand side of the
pipeline has already exited.
Diffstat (limited to 'Src/jobs.c')
-rw-r--r--Src/jobs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/jobs.c b/Src/jobs.c
index 9284c7124..d1b98ac4d 100644
--- a/Src/jobs.c
+++ b/Src/jobs.c
@@ -232,11 +232,12 @@ super_job(int sub)
 static int
 handle_sub(int job, int fg)
 {
+    /* job: superjob; sj: subjob. */
     Job jn = jobtab + job, sj = jobtab + jn->other;
 
     if ((sj->stat & STAT_DONE) || (!sj->procs && !sj->auxprocs)) {
 	struct process *p;
-		    
+
 	for (p = sj->procs; p; p = p->next) {
 	    if (WIFSIGNALED(p->status)) {
 		if (jn->gleader != mypgrp && jn->procs->next)