summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/posix/Select.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/rts/posix/Select.c b/rts/posix/Select.c
index d638829fc9..3d92a4666a 100644
--- a/rts/posix/Select.c
+++ b/rts/posix/Select.c
@@ -221,19 +221,10 @@ awaitEvent(rtsBool wait)
ptv = NULL;
}
- while (1) { // repeat the select on EINTR
-
- // Disable the timer signal while blocked in
- // select(), to conserve power. (#1623, #5991)
- if (wait) stopTimer();
-
- numFound = select(maxfd+1, &rfd, &wfd, NULL, ptv);
-
- if (wait) startTimer();
-
- if (numFound >= 0) break;
-
- if (errno != EINTR) {
+ /* Check for any interesting events */
+
+ while ((numFound = select(maxfd+1, &rfd, &wfd, NULL, ptv)) < 0) {
+ if (errno != EINTR) {
/* Handle bad file descriptors by unblocking all the
waiting threads. Why? Because a thread might have been
a bit naughty and closed a file descriptor while another