Fix bug introduced in fac8ecbbafde17dd92439c41747223c43e9d2b80
authorSimon Marlow <marlowsd@gmail.com>
Thu, 19 Jan 2012 09:33:52 +0000 (09:33 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 19 Jan 2012 16:21:04 +0000 (16:21 +0000)
Fixes recent failures in hGetBuf001.

rts/posix/Select.c

index ffe72e8..013b374 100644 (file)
@@ -182,18 +182,18 @@ awaitEvent(rtsBool wait)
        }
       }
 
-      if (wait) {
-          ptv = NULL;
+      if (!wait) {
+          // just poll
+          tv.tv_sec  = 0;
+          tv.tv_usec = 0;
+          ptv = &tv;
       } else if (sleeping_queue != END_TSO_QUEUE) {
           Time min = LowResTimeToTime(sleeping_queue->block_info.target - now);
           tv.tv_sec  = TimeToSeconds(min);
           tv.tv_usec = TimeToUS(min) % 1000000;
           ptv = &tv;
       } else {
-          // just poll
-          tv.tv_sec  = 0;
-          tv.tv_usec = 0;
-          ptv = &tv;
+          ptv = NULL;
       }
 
       /* Check for any interesting events */