4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-02 20:40:24 +08:00

3 Commits

Author SHA1 Message Date
Corinna Vinschen
c43952da4e 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>
2020-10-14 10:54:13 -04:00
Takashi Yano
5ce1b29320 Cygwin: console: Fix segfault on shared_console_info access.
- Accessing shared_console_info before initialization causes access
  violation because it is a NULL pointer. The cause of the problem
  reported in https://cygwin.com/ml/cygwin/2020-02/msg00197.html is
  this NULL pointer access in request_xterm_mode_output() when it is
  called from close(). This patch makes sure that shared_console_info
  is not NULL before calling request_xterm_mode_output().
2020-10-14 10:54:12 -04:00
Corinna Vinschen
9f8092e407 Cygwin: add release message for NUL character bugs
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2020-10-14 10:54:12 -04:00