ksh/ksh93-foreground-prgrp.dif
2012-02-09 09:56:55 +00:00

14 lines
403 B
Plaintext

--- src/cmd/ksh93/sh/jobs.c
+++ src/cmd/ksh93/sh/jobs.c 2012-02-08 11:52:14.000000000 +0100
@@ -841,7 +841,9 @@ static void job_reset(register struct pr
{
/* 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(tcsetpgrp(job.fd,job.mypid) !=0)
return;
#endif /* SIGTSTP */