1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

thread.c: int32_t instead of suseconds_t

* thread.c (timeval_for): cast to int32_t instead of suseconds_t,
  which is not defined non-POSIX platforms.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62276 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2018-02-07 06:49:32 +00:00
parent b0cf1c234c
commit 76c5787c38

View file

@ -225,7 +225,7 @@ timeval_for(struct timeval *tv, const struct timespec *ts)
{
if (tv && ts) {
tv->tv_sec = ts->tv_sec;
tv->tv_usec = (suseconds_t)(ts->tv_nsec / 1000);
tv->tv_usec = (int32_t)(ts->tv_nsec / 1000); /* 10**6 < 2**(32-1) */
return tv;
}
return 0;