diff options
author | Christopher Faylor <me@cgf.cx> | 2010-10-23 22:07:08 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-10-23 22:07:08 +0400 |
commit | 4ce975efd3d490db601ee16e5b73cba644a2ed40 (patch) | |
tree | 6a433f769058632b4dbbbd8aa8512e7ed6217012 /winsup/cygwin/fhandler_termios.cc | |
parent | 2e859e07599abd6bbd54c98d5c69e3b3cd41929e (diff) |
* fhandler.h (fhandler_termios::tcinit): Make second argument non-optional.
* fhandler_console.cc (fhandler_console::open): Specify second argument to
tcinit.
* fhandler_termios.cc (fhandler_termios::tcinit): Rename second argument. Set
pgid to 0 if this is a pty master.
(fhandler_termios::tcgetpgrp): Just return value of pgid. It will be zero if
not initialized.
* fhandler_tty.cc (fhandler_tty_slave::open): Specify second argument to
tcinit.
(fhandler_tty_slave::ioctl): Implement TIOCGPRP/TIOCSPGRP. Fix switch
indentation.
(fhandler_tty_master::ioctl): Implement TIOCGPRP/TIOCSPGRP.
* include/sys/termios.h (TIOCGPGRP): Define similarly to Linux.
* include/sys/termios.h (TIOCSPGRP): Ditto.
Diffstat (limited to 'winsup/cygwin/fhandler_termios.cc')
-rw-r--r-- | winsup/cygwin/fhandler_termios.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 0f27a9838..6e0ad6777 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -23,13 +23,13 @@ details. */ /* Common functions shared by tty/console */ void -fhandler_termios::tcinit (tty_min *this_tc, bool force) +fhandler_termios::tcinit (tty_min *this_tc, bool is_pty_master) { /* Initial termios values */ tc = this_tc; - if (force || !tc->initialized ()) + if (is_pty_master || !tc->initialized ()) { tc->ti.c_iflag = BRKINT | ICRNL | IXON; tc->ti.c_oflag = OPOST | ONLCR; @@ -55,7 +55,7 @@ fhandler_termios::tcinit (tty_min *this_tc, bool force) tc->ti.c_cc[VWERASE] = CWERASE; tc->ti.c_ispeed = tc->ti.c_ospeed = B38400; - tc->pgid = myself->pgid; + tc->pgid = is_pty_master ? 0 : myself->pgid; tc->initialized (true); } } @@ -108,7 +108,7 @@ fhandler_termios::tcgetpgrp () int fhandler_pty_master::tcgetpgrp () { - return myself->ctty != -1 && myself->ctty == tc->ntty ? tc->pgid : 0; + return tc->pgid; } void |