ash: fix infinite loop on exit if tty is not there anymore

This commit is contained in:
Denis Vlasenko
2007-04-28 22:39:02 +00:00
parent e3f2f89891
commit 08c8c1d3b3
2 changed files with 8 additions and 1 deletions
+3 -1
View File
@@ -3501,7 +3501,9 @@ setjobctl(int on)
/* turning job control off */
fd = ttyfd;
pgrp = initialpgrp;
xtcsetpgrp(fd, pgrp);
/* was xtcsetpgrp, but this can make exiting ash
* with pty already deleted loop forever */
tcsetpgrp(fd, pgrp);
setpgid(0, pgrp);
setsignal(SIGTSTP);
setsignal(SIGTTOU);