]> sourceware.org Git - newlib-cygwin.git/commitdiff
* fhandler.cc (fhandler_base::setup_overlapped): Don't set signalled state to
authorChristopher Faylor <me@cgf.cx>
Mon, 15 Feb 2010 01:45:05 +0000 (01:45 +0000)
committerChristopher Faylor <me@cgf.cx>
Mon, 15 Feb 2010 01:45:05 +0000 (01:45 +0000)
true initially.
(fhandler_base::has_ongoing_io): Delete ill-advised function.
(fhandler_base::read_overlapped): Rely on caller having checked nonblocking
state.  Don't attempt to (incorrectly) check it here.
(fhandler_base::write_overlapped): Remove call to has_ongoing_io.
* select.cc (peek_pipe): Ditto.
* fhandler.h (fhandler_base::has_ongoing_io): Delete declaration.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler.cc
winsup/cygwin/fhandler.h
winsup/cygwin/select.cc

index 7682cf1dd4eda1dfbdb1418bdd563aa97e7cffd5..a908136de592f9be0e90f87b4cf32daae8d91c30 100644 (file)
@@ -1,3 +1,14 @@
+2010-02-14  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * fhandler.cc (fhandler_base::setup_overlapped): Don't set signalled
+       state to true initially.
+       (fhandler_base::has_ongoing_io): Delete ill-advised function.
+       (fhandler_base::read_overlapped): Rely on caller having checked
+       nonblocking state.  Don't attempt to (incorrectly) check it here.
+       (fhandler_base::write_overlapped): Remove call to has_ongoing_io.
+       * select.cc (peek_pipe): Ditto.
+       * fhandler.h (fhandler_base::has_ongoing_io): Delete declaration.
+
 2010-02-14  Christopher Faylor  <me+cygwin@cgf.cx>
 
        * regex/regcomp.c (xwcrtomb): Fix one explicable and one inexcplicable
index 26a3ad8eef8a20cc27ac2d2cfc4b30b0cc4241e9..8e84383144a648d25f600989adc8de3fa37b6dd1 100644 (file)
@@ -1647,7 +1647,7 @@ fhandler_base::setup_overlapped (bool doit)
   if (doit)
     {
       set_overlapped (ov);
-      res = !!(ov->hEvent = CreateEvent (&sec_none_nih, true, true, NULL));
+      res = !!(ov->hEvent = CreateEvent (&sec_none_nih, true, false, NULL));
     }
   else
     {
@@ -1751,29 +1751,12 @@ fhandler_base::wait_overlapped (bool inres, bool writing, DWORD *bytes, DWORD le
   return res;
 }
 
-bool __stdcall
-fhandler_base::has_ongoing_io (bool testit)
-{
-  if (testit && get_overlapped () && get_overlapped ()->hEvent
-      && WaitForSingleObject (get_overlapped ()->hEvent, 0) != WAIT_OBJECT_0)
-    {
-      set_errno (EAGAIN);
-      return true;
-    }
-  return false;
-}
-
 void __stdcall
 fhandler_base::read_overlapped (void *ptr, size_t& len)
 {
   DWORD nbytes;
   while (1)
     {
-      if (has_ongoing_io (is_nonblocking ()))
-       {
-         nbytes = (DWORD) -1;
-         break;
-       }
       bool res = ReadFile (get_handle (), ptr, len, &nbytes,
                           get_overlapped ());
       int wres = wait_overlapped (res, false, &nbytes);
@@ -1789,11 +1772,6 @@ fhandler_base::write_overlapped (const void *ptr, size_t len)
   DWORD nbytes;
   while (1)
     {
-      if (has_ongoing_io (is_nonblocking ()))
-       {
-         nbytes = (DWORD) -1;
-         break;
-       }
       bool res = WriteFile (get_output_handle (), ptr, len, &nbytes,
                            get_overlapped ());
       int wres = wait_overlapped (res, true, &nbytes, (size_t) len);
index 8ef56e0df4cba0fae7c2034f12a90ce4eec656c0..d1130d4eaa7ad1d99d1fee1f8dd5241ee0aa54ad 100644 (file)
@@ -311,7 +311,6 @@ class fhandler_base
   virtual char const *ttyname () { return get_name (); }
   virtual void __stdcall read (void *ptr, size_t& len) __attribute__ ((regparm (3)));
   virtual void __stdcall read_overlapped (void *ptr, size_t& len) __attribute__ ((regparm (3)));
-  virtual bool __stdcall has_ongoing_io (bool) __attribute__ ((regparm (2)));
   virtual ssize_t __stdcall write (const void *ptr, size_t len);
   virtual ssize_t __stdcall write_overlapped (const void *ptr, size_t len);
   virtual ssize_t __stdcall readv (const struct iovec *, int iovcnt, ssize_t tot = -1);
index 64c3cdecddffd03f572911d262f713469d817be6..e1906cb14eb2a2b38117609d8a78da246eb57256 100644 (file)
@@ -526,8 +526,6 @@ out:
       else if (fh->get_device () == FH_PIPER)
        select_printf ("%s, select for write on read end of pipe",
                       fh->get_name ());
-      else if (fh->has_ongoing_io (true))
-       s->write_ready = false;
       else
        {
          IO_STATUS_BLOCK iosb = {0};
This page took 0.041938 seconds and 5 git commands to generate.