* 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.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user