aboutsummaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-04-28 22:39:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-04-28 22:39:02 +0000
commit08c8c1d3b33de1156d8a7030ba2797276b8ff351 (patch)
treec386a79f3a9347cbba9b224357801e69ab1b9e4d /shell/ash.c
parente3f2f8989139f00e94473882366bd665d4fcc800 (diff)
downloadbusybox-08c8c1d3b33de1156d8a7030ba2797276b8ff351.tar.gz
ash: fix infinite loop on exit if tty is not there anymore
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 90936fcc0..16818cfc9 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -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);