diff --git a/winsup/cygwin/fhandler_serial.cc b/winsup/cygwin/fhandler_serial.cc index 615b2513f..69e5768f6 100644 --- a/winsup/cygwin/fhandler_serial.cc +++ b/winsup/cygwin/fhandler_serial.cc @@ -519,14 +519,7 @@ fhandler_serial::ioctl (unsigned int cmd, void *buf) } break; case TIOCINQ: - if (ev & CE_FRAME || ev & CE_IOE || ev & CE_OVERRUN || ev & CE_RXOVER - || ev & CE_RXPARITY) - { - set_errno (EINVAL); /* FIXME: Use correct errno */ - res = -1; - } - else - ipbuf = st.cbInQue; + ipbuf = st.cbInQue; break; case TIOCGWINSZ: ((struct winsize *) buf)->ws_row = 0; diff --git a/winsup/cygwin/release/3.1.5 b/winsup/cygwin/release/3.1.5 index e34fdb88d..e567ecb32 100644 --- a/winsup/cygwin/release/3.1.5 +++ b/winsup/cygwin/release/3.1.5 @@ -9,3 +9,6 @@ Bug Fixes: - Fix a segfault when starting, e.g., mintty from a bash in a console running xterm emulation. Addresses: https://cygwin.com/ml/cygwin/2020-02/msg00197.html + +- Fix TIOCINQ to always return number of inbound chars if available. + Addresses: https://cygwin.com/ml/cygwin/2020-02/msg00258.html