diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-09-18 22:54:48 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-09-18 22:54:48 +0400 |
commit | 41946df6111b6daf93518b22ca49c54544c77599 (patch) | |
tree | e8a7cbbdc46dab7e8c46f938e8ccc4acd0f8d131 /winsup/cygwin/termios.cc | |
parent | b1e00863f3c6c84b0ae3a67db9d3b20f536ffb72 (diff) |
* fhandler_tty.cc (fhandler_pty_master::process_slave_output):
Handle buf == NULL as flushing the buffer.
(fhandler_tty_slave::read): Handle ptr == NULL as flushing the buffer.
(fhandler_tty_slave::tcflush): Implement input queue flushing by
calling read with NULL buffer.
(fhandler_pty_master::tcflush): Ditto, calling process_slave_output.
* termios.cc (tcflush): Check for legal `queue' value. Return
EINVAL otherwise.
Diffstat (limited to 'winsup/cygwin/termios.cc')
-rw-r--r-- | winsup/cygwin/termios.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/termios.cc b/winsup/cygwin/termios.cc index 60ef9641f..c82f771b7 100644 --- a/winsup/cygwin/termios.cc +++ b/winsup/cygwin/termios.cc @@ -79,6 +79,8 @@ tcflush (int fd, int queue) if (!cfd->is_tty ()) set_errno (ENOTTY); + else if (queue != TCIFLUSH && queue != TCOFLUSH && queue != TCIOFLUSH) + set_errno (EINVAL); else if ((res = cfd->bg_check (-SIGTTOU)) > bg_eof) res = cfd->tcflush (queue); |