]> sourceware.org Git - newlib-cygwin.git/commitdiff
* select.cc (fhandler_tty_slave::ready_for_read): Return 0 on EBADF.
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 8 Nov 2001 15:01:44 +0000 (15:01 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 8 Nov 2001 15:01:44 +0000 (15:01 +0000)
* syscalls.cc (_read): If ready_for_read() failed, save errno from
being overwritten by signal handler call.

winsup/cygwin/ChangeLog
winsup/cygwin/select.cc
winsup/cygwin/syscalls.cc

index 78e345ec50e70986bd3fa1413eb8ca3d71ec8fe1..12a6578e8f79c20693d2ff17d01a68e67720ac10 100644 (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
index 50582727d80a8b8a3b25355d0e1750db8654e126..663997446272d89d247d296786ad4c690d757bf6 100644 (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 ())
     {
index 3b2104d7f7a91231b6c177441bde244930b9848b..fc069ca7354cf4d583b50a6b71fde460eed675f9 100644 (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;
        }
This page took 0.034076 seconds and 5 git commands to generate.