OSDN Git Service

* select.cc (cygwin_select): Fifth time is the charm.
authorcgf <cgf>
Fri, 9 Dec 2011 03:19:41 +0000 (03:19 +0000)
committercgf <cgf>
Fri, 9 Dec 2011 03:19:41 +0000 (03:19 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/select.cc

index 7bcb6e3..507bbc4 100644 (file)
@@ -1,5 +1,9 @@
 2011-12-08  Christopher Faylor  <me.cygwin2011@cgf.cx>
 
+       * select.cc (cygwin_select): Fifth time is the charm.
+
+2011-12-08  Christopher Faylor  <me.cygwin2011@cgf.cx>
+
        * select.cc (cygwin_select): Make sure that 0 is returned when sel.wait
        times out.
 
index e87e639..f409c6c 100644 (file)
@@ -143,11 +143,14 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
        pthread::static_cancel_self ();
        /*NOTREACHED*/
       default:
-       res = 0;
+       res = 1;
        break;
       }
-  else if ((sel.always_ready || ms == 0)
-          || (res = sel.wait (r, w, e, ms)) >= 0)
+  else if (sel.always_ready || ms == 0)
+    res = 0;
+  else
+    res = sel.wait (r, w, e, ms);
+  if (res >= 0)
     {
       copyfd_set (readfds, r, maxfds);
       copyfd_set (writefds, w, maxfds);