mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/date/date_core.c (date_s_today, datetime_s_now): check the
result of localtime_r(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31949 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8137c55558
commit
b59179c873
2 changed files with 9 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Tue Jun 7 13:59:47 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/date/date_core.c (date_s_today, datetime_s_now): check the
|
||||
result of localtime_r().
|
||||
|
||||
Tue Jun 7 13:36:51 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/tk/extconf.rb: use $defs not $CPPFLAGS to get rid of
|
||||
|
|
|
@ -3483,7 +3483,8 @@ date_s_today(int argc, VALUE *argv, VALUE klass)
|
|||
|
||||
if (time(&t) == -1)
|
||||
rb_sys_fail("time");
|
||||
localtime_r(&t, &tm);
|
||||
if (!localtime_r(&t, &tm))
|
||||
rb_sys_fail("localtime");
|
||||
|
||||
y = tm.tm_year + 1900;
|
||||
m = tm.tm_mon + 1;
|
||||
|
@ -7288,7 +7289,8 @@ datetime_s_now(int argc, VALUE *argv, VALUE klass)
|
|||
rb_sys_fail("gettimeofday");
|
||||
sec = tv.tv_sec;
|
||||
#endif
|
||||
localtime_r(&sec, &tm);
|
||||
if (!localtime_r(&sec, &tm))
|
||||
rb_sys_fail("localtime");
|
||||
|
||||
y = tm.tm_year + 1900;
|
||||
m = tm.tm_mon + 1;
|
||||
|
|
Loading…
Reference in a new issue