Skip to content

Commit

Permalink
job_reset(): fix for resetting foreground process group
Browse files Browse the repository at this point in the history
Patch from OpenSUSE:
https://build.opensuse.org/package/view_file/shells/ksh/ksh93-foreground-prgrp.dif

src/cmd/ksh93/sh/jobs.c: job_reset():
- Only reset the foreground process group associated with the
  current job if the current job's process ID is different from the
  terminal's foreground process group ID.
  • Loading branch information
McDutchie committed Feb 2, 2021
1 parent 9f980ba commit 4645e6a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cmd/ksh93/sh/jobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,9 @@ static void job_reset(register struct process *pw)
{
/* save the terminal state for current job */
#ifdef SIGTSTP
job_fgrp(pw,tcgetpgrp(job.fd));
pid_t tgrp;
if((tgrp=tcgetpgrp(job.fd))!=job.mypid)
job_fgrp(pw,tgrp);
if(sh_isoption(SH_INTERACTIVE) && tcsetpgrp(job.fd,job.mypid) !=0)
return;
#endif /* SIGTSTP */
Expand Down

0 comments on commit 4645e6a

Please sign in to comment.