1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-03 22:32:12 +02:00

50134: Tweak process group handling to prevent unkillable pipelines

In some cases the process group leader of the forked-left side of a
pipe needs to be set to the pipe process PID rather than to the group
leader PID returned by entersubsh().
This commit is contained in:
Bart Schaefer 2022-04-29 20:25:53 -07:00
parent 8eccdc5cb7
commit 15bf8ace16
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,7 @@
2022-04-29 Bart Schaefer <schaefer@Macadamia>
2022-04-29 Bart Schaefer <schaefer@zsh.org>
* 50134: Src/jobs.c: Tweak process group handling (workers/43409)
to avoid creating "unkillable" pipelines that ignore signals
* unposted: Etc/BUGS: Details about STTY; consistency nit

View file

@ -1476,7 +1476,10 @@ addproc(pid_t pid, char *text, int aux, struct timeval *bgtime,
* set it for that, too.
*/
if (gleader != -1) {
jobtab[thisjob].gleader = gleader;
if (jobtab[thisjob].stat & STAT_CURSH)
jobtab[thisjob].gleader = gleader;
else
jobtab[thisjob].gleader = pid;
if (list_pipe_job_used != -1)
jobtab[list_pipe_job_used].gleader = gleader;
/*