Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2011-12-09 00:24:33 +0400
committerChristopher Faylor <me@cgf.cx>2011-12-09 00:24:33 +0400
commit203f97378930be399dcec2b9f5778eb26a482df1 (patch)
tree1a78f2e1e3aafe7a2a66bebfe234465f977a7598 /winsup
parent2398bcaea4cf11328ed910909cc415329d33a0b9 (diff)
* select.cc (cygwin_select): Make sure that 0 is returned when sel.wait times
out.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/select.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index b16708e44..7bcb6e3b4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
+ * select.cc (cygwin_select): Make sure that 0 is returned when sel.wait
+ times out.
+
+2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
+
* include/sys/wait.h: Add in all c++ functions.
2011-12-08 Christopher Faylor <me.cygwin2011@cgf.cx>
diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 242a1609e..e87e639f6 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -147,12 +147,12 @@ cygwin_select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
break;
}
else if ((sel.always_ready || ms == 0)
- || (res = sel.wait (r, w, e, ms)) == 0)
+ || (res = sel.wait (r, w, e, ms)) >= 0)
{
copyfd_set (readfds, r, maxfds);
copyfd_set (writefds, w, maxfds);
copyfd_set (exceptfds, e, maxfds);
- res = sel.poll (readfds, writefds, exceptfds);
+ res = (res > 0) ? 0 : sel.poll (readfds, writefds, exceptfds);
}
syscall_printf ("%R = select (%d, %p, %p, %p, %p)", res, maxfds, readfds,