summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-19 15:21:00 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-07-19 15:21:00 (GMT)
commit747129ae536f51b52cac4a8793a3613dc2467850 (patch)
tree7d0dad83fee20329bd749f6363abe871604a2cd3 /thread.c
parent28c389c676ded8f7f86fb89fd7fae23b52327970 (diff)
thread.c: fix timeout limit
* thread.c (ppoll): fix the limit, timeout argument of poll(2) is an int but not a time_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/thread.c b/thread.c
index 7bef5eb..46976e5 100644
--- a/thread.c
+++ b/thread.c
@@ -3622,15 +3622,15 @@ ppoll(struct pollfd *fds, nfds_t nfds,
if (ts) {
int tmp, tmp2;
- if (ts->tv_sec > TIMET_MAX/1000)
+ if (ts->tv_sec > INT_MAX/1000)
timeout_ms = -1;
else {
- tmp = ts->tv_sec * 1000;
- tmp2 = ts->tv_nsec / (1000 * 1000);
- if (TIMET_MAX - tmp < tmp2)
+ tmp = (int)(ts->tv_sec * 1000);
+ tmp2 = (int)(ts->tv_nsec / (1000 * 1000));
+ if (INT_MAX - tmp < tmp2)
timeout_ms = -1;
else
- timeout_ms = tmp + tmp2;
+ timeout_ms = (int)(tmp + tmp2);
}
}
else