da915a3aa6
guaranteed to be accurate. * fhandler_tty.cc (fhandler_tty_slave::open): Increment open_fhs appropriate when copying ctty. (fhandler_tty_slave::close): Remove special case handling for exit_state. Use ctty < 0 check instead. (fhandler_tty_common::close): Set io_handle to NULL after closing. * syscalls.cc (close_all_files): Specifically close cygheap->ctty, if appropriate.