summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-16 07:15:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-16 07:15:15 +0000
commit370b3e4524a273fe54ee6f71ae7721b0066a1518 (patch)
tree628aaca3006323e4a5ec4b23bc021074590729ac /eval.c
parent2d597476bba53c99b1a3345ae4a91739c62dab8d (diff)
* eval.c (rb_thread_select): cleanup conditional compilation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c25
1 files changed, 6 insertions, 19 deletions
diff --git a/eval.c b/eval.c
index 032ddfdc93..11d6a81797 100644
--- a/eval.c
+++ b/eval.c
@@ -7886,6 +7886,9 @@ rb_thread_select(max, read, write, except, timeout)
tv = *timeout;
tvp = &tv;
}
+#else
+ struct timeval *const tvp = timeout;
+#endif
for (;;) {
TRAP_BEG;
n = select(max, read, write, except, tvp);
@@ -7896,14 +7899,16 @@ rb_thread_select(max, read, write, except, timeout)
#ifdef ERESTART
case ERESTART:
#endif
+#ifndef linux
if (timeout) {
- double d = limit - timeofday();
+ double d = limit - timeofday();
tv.tv_sec = (unsigned int)d;
tv.tv_usec = (long)((d-(double)tv.tv_sec)*1e6);
if (tv.tv_sec < 0) tv.tv_sec = 0;
if (tv.tv_usec < 0) tv.tv_usec = 0;
}
+#endif
continue;
default:
break;
@@ -7911,24 +7916,6 @@ rb_thread_select(max, read, write, except, timeout)
}
return n;
}
-#else
- for (;;) {
- TRAP_BEG;
- n = select(max, read, write, except, timeout);
- TRAP_END;
- if (n < 0) {
- switch (errno) {
- case EINTR:
-#ifdef ERESTART
- case ERESTART:
-#endif
- continue;
- }
- }
- return n;
- }
-#endif
-
}
curr_thread->status = THREAD_STOPPED;