jackpal/Android-Terminal-Emulator — pull request #291 by phantom10111 (2014-02-08 13:33:13+00:00)
Title: Exec procedure improvements

The java process maintains many open file descriptors that are inherited by the shell process (and later on by any command spawned by the shell). This code closes all of them by iterating over the /proc/self/fd directory. Also includes an ioctl call to make the pseudoterminal a controlling one for the shell process group.