From 8714982ceffd3775501059563d1cb33d83ea00ef Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 9 Dec 2011 03:19:41 +0000 Subject: [PATCH] * select.cc (cygwin_select): Fifth time is the charm. --- winsup/cygwin/ChangeLog | 4 ++++ winsup/cygwin/select.cc | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 7bcb6e3b4..507bbc428 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,7 @@ +2011-12-08 Christopher Faylor + + * select.cc (cygwin_select): Fifth time is the charm. + 2011-12-08 Christopher Faylor * select.cc (cygwin_select): Make sure that 0 is returned when sel.wait diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index e87e639f6..f409c6c5a 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -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);