diff options
author | nagachika <nagachika@ruby-lang.org> | 2021-03-20 13:02:33 +0900 |
---|---|---|
committer | nagachika <nagachika@ruby-lang.org> | 2021-03-20 13:02:33 +0900 |
commit | 9994860dcb56697fad1799128d1493adc06b23c7 (patch) | |
tree | e25495d68ea821ec044c3aa49b90443765d4fb78 | |
parent | 30942fc4d89a04792e9eba7d3c4e5009c54e81da (diff) |
merge revision(s) 2a6bfd22468343003463e0cbf91953a01b0dbba5,3ac28de5414c81a0da8c8ec969ea74db5a0f1b0f: [Backport #17645]
Properly convert time_t [Bug #17645]
---
thread_sync.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Explicitly cast __s64 to time_t [Bug #17645]
A workaround of shorten-64-to-32 error where 32-bit linux.
---
file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
-rw-r--r-- | file.c | 2 | ||||
-rw-r--r-- | thread_sync.c | 2 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -1224,7 +1224,7 @@ statx_birthtime(const struct statx *stx, VALUE fname) /* birthtime is not supported on the filesystem */ statx_notimplement("birthtime"); } - return rb_time_nano_new(stx->stx_btime.tv_sec, stx->stx_btime.tv_nsec); + return rb_time_nano_new((time_t)stx->stx_btime.tv_sec, stx->stx_btime.tv_nsec); } typedef struct statx statx_data; diff --git a/thread_sync.c b/thread_sync.c index efe295e64c..4c065dd25b 100644 --- a/thread_sync.c +++ b/thread_sync.c @@ -484,7 +484,7 @@ rb_mutex_sleep(VALUE self, VALUE timeout) } RUBY_VM_CHECK_INTS_BLOCKING(GET_EC()); end = time(0) - beg; - return INT2FIX(end); + return TIMET2NUM(end); } /* @@ -2,7 +2,7 @@ # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR #define RUBY_VERSION_TEENY 3 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR -#define RUBY_PATCHLEVEL 162 +#define RUBY_PATCHLEVEL 163 #define RUBY_RELEASE_YEAR 2021 #define RUBY_RELEASE_MONTH 3 |