]> sourceware.org Git - newlib-cygwin.git/commit
Cygwin: ioctl: TIOCINQ: always return number of chars in the inbound queue
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 2 Mar 2020 16:02:51 +0000 (17:02 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 2 Mar 2020 16:05:59 +0000 (17:05 +0100)
commit1b7fcf22bea529fba920310dcd2db144bb24ccc6
treeb4cc25fcd61e0ea4358e0c63ecef12c9c2605ae0
parentcef36220f247e02847ee4f39790b7debcc50a36b
Cygwin: ioctl: TIOCINQ: always return number of chars in the inbound queue

So far ioctl(TIOCINQ) could end up returning -1 with errno set to EINVAL
if a non-zero device error mask has been returned by ClearCommError.
This doesn't reflect Linux behaviour, which always returns the number of
chars in the inbound queue, independent of any I/O error condition.
EINVAL was a pretty weird error code to use in this scenario, too.

Fix this by dropping all checking for device errors in the TIOCINQ
case.  Just return the number of chars in the inbound queue.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler_serial.cc
winsup/cygwin/release/3.1.5
This page took 0.026312 seconds and 5 git commands to generate.