ash: fix infinite loop on exit if tty is not there anymore
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 28 Apr 2007 22:39:02 +0000 (22:39 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 28 Apr 2007 22:39:02 +0000 (22:39 -0000)
shell/README
shell/ash.c

index 2b1d05cebfc077a2c1de37024aefdd49bd02fa32..40447cacbe68d36a6b62db533c663324c4ac1881 100644 (file)
@@ -1,5 +1,10 @@
 Various bits of what is known about busybox shells, in no particular order.
 
+2007-04-28
+hush: Ctrl-C and Ctrl-Z for single NOFORK commands are working.
+Memory and other resource leaks (opendir) are not addressed
+(testcase is "rm -i" interrupted by ctrl-c).
+
 2007-04-21
 hush: "sleep 5 | sleep 6" + Ctrl-Z + fg seems to work.
 "rm -i" + Ctrl-C, "sleep 5" + Ctrl-Z still doesn't work
index 90936fcc0364a1f7608f116beb1cd6152aa90802..16818cfc9c9d053ed7d8cebe7207cc045e62f7c5 100644 (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);