summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-16 05:53:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-16 05:53:14 +0000
commit3b89da683fc6387fa1707a2caf5d4842a0ab3d46 (patch)
tree7cd7cec945ffdfccd8d3400b979e2169396ab1d3 /eval.c
parent849fb05bb1511330b13732f54b2473659d277e87 (diff)
* eval.c (rb_thread_select): cleanup conditional compilation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/eval.c b/eval.c
index 628e16c969..9e666d7e47 100644
--- a/eval.c
+++ b/eval.c
@@ -8058,6 +8058,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);
@@ -8068,6 +8071,7 @@ rb_thread_select(max, read, write, except, timeout)
#ifdef ERESTART
case ERESTART:
#endif
+#ifndef linux
if (timeout) {
double d = limit - timeofday();
@@ -8076,6 +8080,7 @@ rb_thread_select(max, read, write, except, timeout)
if (tv.tv_sec < 0) tv.tv_sec = 0;
if (tv.tv_usec < 0) tv.tv_usec = 0;
}
+#endif
continue;
default:
break;
@@ -8083,24 +8088,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;