* 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.
This commit is contained in:
Corinna Vinschen 2001-11-08 15:01:44 +00:00
parent 418c02db8f
commit 036fd823dc
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -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 ())
{

View File

@ -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;
}