diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2001-11-08 15:01:44 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2001-11-08 15:01:44 +0000 |
commit | 036fd823dcf4cf161304a894258477d175b1c3f0 (patch) | |
tree | 45468342744cced78308473cd537e83063d726e7 | |
parent | 418c02db8faef0540377e40c24fee433f2f9cb12 (diff) | |
download | newlib-036fd823dcf4cf161304a894258477d175b1c3f0.zip newlib-036fd823dcf4cf161304a894258477d175b1c3f0.tar.gz newlib-036fd823dcf4cf161304a894258477d175b1c3f0.tar.bz2 |
* select.cc (fhandler_tty_slave::ready_for_read): Return 0 on EBADF.
* syscalls.cc (_read): If ready_for_read() failed, save errno from
being overwritten by signal handler call.
-rw-r--r-- | winsup/cygwin/ChangeLog | 6 | ||||
-rw-r--r-- | winsup/cygwin/select.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 78e345e..12a6578 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2001-11-08 Corinna Vinschen <corinna@vinschen.de> + + * select.cc (fhandler_tty_slave::ready_for_read): Return 0 on EBADF. + * syscalls.cc (_read): If ready_for_read() failed, save errno from + being overwritten by signal handler call. + 2001-11-07 Corinna Vinschen <corinna@vinschen.de> * lib/getopt.c (getopt_internal): Reset optind to 1 only if optreset diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 5058272..6639974 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -781,7 +781,7 @@ fhandler_tty_slave::ready_for_read (int fd, DWORD howlong) if (cygheap->fdtab.not_open (fd)) { set_errno (EBADF); - return 1; + return 0; } if (get_readahead_valid ()) { diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 3b2104d..fc069ca 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -314,6 +314,7 @@ _read (int fd, void *ptr, size_t len) debug_printf ("non-interruptible read\n"); else if (!cfd->ready_for_read (fd, wait)) { + set_sig_errno (get_errno ()); res = -1; goto out; } |