diff options
author | Christopher Faylor <me@cgf.cx> | 2011-10-20 14:02:54 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-10-20 14:02:54 +0000 |
commit | 38d732a152ff27601b385c00e6574111461b65c4 (patch) | |
tree | ce60ae6b1ad6b8ca6e1d71d10cddaffebbf62ab2 /winsup/cygwin/fhandler_tty.cc | |
parent | aa982024d14f9d6c4afe8ada89e5a46585623102 (diff) | |
download | newlib-38d732a152ff27601b385c00e6574111461b65c4.zip newlib-38d732a152ff27601b385c00e6574111461b65c4.tar.gz newlib-38d732a152ff27601b385c00e6574111461b65c4.tar.bz2 |
Throughout change TTY_* to PTY_*, tty_* to pty_*, and ttym_* to ptmx_*.
* devices.cc: Regenerate.
* dtable.cc: (fh_alloc): Preserve /dev/tty name when that's what we opened.
(build_fh_pc): Preserve any existing name.
* fhandler.cc (fhandler_base::open_with_arch): Ditto.
* fhandler_tty.cc (fhandler_pty_master::fhandler_pty_master): Force the name to
/dev/ptmx while preserving other pty master device information.
* path.h (cfree_maybe): New macro.
(path_conv::operator =): Free any allocated strings in target.
(path_conv::free_strings): Delete unused function.
* sigproc.cc (proc_terminate): Remove previous accommodation for execed
processes since it didn't have the desired effect. Change comment to a FIXME.
* spawn.cc (chExeced): Mark NO_COPY.
(exe_suffixes): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_tty.cc')
-rw-r--r-- | winsup/cygwin/fhandler_tty.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc index aee5b80..f3a9a5f 100644 --- a/winsup/cygwin/fhandler_tty.cc +++ b/winsup/cygwin/fhandler_tty.cc @@ -359,7 +359,7 @@ fhandler_pty_slave::fhandler_pty_slave (int unit) : fhandler_pty_common (), inuse (NULL) { if (unit >= 0) - dev ().parse (DEV_TTYS_MAJOR, unit); + dev ().parse (DEV_PTYS_MAJOR, unit); } int @@ -953,7 +953,7 @@ fhandler_pty_slave::ioctl (unsigned int cmd, void *arg) return res; if (myself->pgid && get_ttyp ()->getpgid () != myself->pgid - && (unsigned) myself->ctty == FHDEV (DEV_TTYS_MAJOR, get_unit ()) + && (unsigned) myself->ctty == FHDEV (DEV_PTYS_MAJOR, get_unit ()) && (get_ttyp ()->ti.c_lflag & TOSTOP)) { /* background process */ @@ -1191,9 +1191,13 @@ fhandler_pty_master::fhandler_pty_master (int unit) dwProcessId (0), need_nl (0) { if (unit >= 0) - dev ().parse (DEV_TTYM_MAJOR, unit); + dev ().parse (DEV_PTYM_MAJOR, unit); else if (!setup ()) - dev ().parse (FH_ERROR); + { + dev ().parse (FH_ERROR); + return; + } + set_name ("/dev/ptmx"); } int @@ -1682,7 +1686,7 @@ fhandler_pty_master::setup () t.winsize.ws_row = 25; t.master_pid = myself->pid; - dev ().parse (DEV_TTYM_MAJOR, unit); + dev ().parse (DEV_PTYM_MAJOR, unit); termios_printf ("this %p, pty%d opened - from_pty %p, to_pty %p", this, unit, get_io_handle (), get_output_handle ()); |