mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merge revision(s) 47196: [Backport #10144]
* time.c (time_timespec): fix tv_nsec overflow [Bug #10144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@47501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
33e54f3400
commit
b84c5c3e36
3 changed files with 10 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Sep 10 12:25:24 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* time.c (time_timespec): fix tv_nsec overflow
|
||||
[Bug #10144]
|
||||
|
||||
Wed Sep 10 12:21:51 2014 Eric Wong <e@80x24.org>
|
||||
|
||||
* ext/zlib/zlib.c (gzfile_reset): preserve ZSTREAM_FLAG_GZFILE
|
||||
|
|
4
time.c
4
time.c
|
@ -2435,6 +2435,10 @@ time_timespec(VALUE num, int interval)
|
|||
d = modf(RFLOAT_VALUE(num), &f);
|
||||
if (d >= 0) {
|
||||
t.tv_nsec = (int)(d*1e9+0.5);
|
||||
if (t.tv_nsec >= 1000000000) {
|
||||
t.tv_nsec -= 1000000000;
|
||||
f += 1;
|
||||
}
|
||||
}
|
||||
else if ((t.tv_nsec = (int)(-d*1e9+0.5)) > 0) {
|
||||
t.tv_nsec = 1000000000 - t.tv_nsec;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.0.0"
|
||||
#define RUBY_RELEASE_DATE "2014-09-10"
|
||||
#define RUBY_PATCHLEVEL 562
|
||||
#define RUBY_PATCHLEVEL 563
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2014
|
||||
#define RUBY_RELEASE_MONTH 9
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue