From 4bf6a52173d6e552359c8f5f1fcd0861d22d64af Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 3 Dec 2013 20:28:55 +0000 Subject: [PATCH] * select.cc (select): Add workaround for, as yet undebugged, pathological case. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/select.cc | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d8d60b863..89dce26f6 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2013-12-03 Christopher Faylor + + * select.cc (select): Add workaround for, as yet undebugged, + pathological case. + 2013-12-01 Christopher Faylor * dtable.cc (dtable::find_unused_handle): Break out of the right loop. diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index 7dd17f395..e923f9161 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -189,8 +189,11 @@ select (int maxfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, copyfd_set (readfds, r, maxfds); copyfd_set (writefds, w, maxfds); copyfd_set (exceptfds, e, maxfds); - /* Actually set the bit mask from sel records */ - res = (res == select_stuff::select_set_zero) ? 0 : sel.poll (readfds, writefds, exceptfds); + if (res == select_stuff::select_set_zero) + res = 0; + else + /* Set the bit mask from sel records */ + res = sel.poll (readfds, writefds, exceptfds) ?: select_stuff::select_loop; } /* Always clean up everything here. If we're looping then build it all up again. */ @@ -389,7 +392,7 @@ next_while:; wait_ret = MsgWaitForMultipleObjectsEx (m, w4, ms, QS_ALLINPUT | QS_ALLPOSTMESSAGE, MWMO_INPUTAVAILABLE); - select_printf ("wait_ret %d. verifying", wait_ret); + select_printf ("wait_ret %d, m = %d. verifying", wait_ret, m); wait_states res; switch (wait_ret)