Reproducer steps :

$ cat p1
#!/bin/ksh
while true
do
  echo -n "Exit (y/n)? " 1>&2
  read V
  if [ "${V}" = "y" ]
  then
    exit 1
  fi
  sleep 1
done


$ cat p2
#!/bin/ksh
sleep 1
exit


Run as :

$ taskset 1 ksh
$ ./p1 | ./p2


First process will continue to receive SIGTTIN and SIGCONT. Attached patch 
fixes this issue.

-- 
--
Siteshwar Vashisht
diff --git a/src/cmd/ksh93/sh/jobs.c b/src/cmd/ksh93/sh/jobs.c
--- a/src/cmd/ksh93/sh/jobs.c
+++ b/src/cmd/ksh93/sh/jobs.c
@@ -1579,6 +1579,7 @@ int	job_wait(register pid_t pid)
 					if( pw->p_exit!=SIGTTIN && pw->p_exit!=SIGTTOU)
 						break;
 
+					tcsetpgrp(JOBTTY,pw->p_pgrp);
 					killpg(pw->p_pgrp,SIGCONT);
 				}
 				else /* ignore stop when non-interactive */
_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to