[前][次][番号順一覧][スレッド一覧]

ruby-changes:19902

From: nobu <ko1@a...>
Date: Tue, 7 Jun 2011 14:00:11 +0900 (JST)
Subject: [ruby-changes:19902] nobu:r31949 (trunk): * ext/date/date_core.c (date_s_today, datetime_s_now): check the

nobu	2011-06-07 14:00:04 +0900 (Tue, 07 Jun 2011)

  New Revision: 31949

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31949

  Log:
    * ext/date/date_core.c (date_s_today, datetime_s_now): check the
      result of localtime_r().

  Modified files:
    trunk/ChangeLog
    trunk/ext/date/date_core.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31948)
+++ ChangeLog	(revision 31949)
@@ -1,3 +1,8 @@
+Tue Jun  7 13:59:47 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* 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@r...>
 
 	* ext/tk/extconf.rb: use $defs not $CPPFLAGS to get rid of
Index: ext/date/date_core.c
===================================================================
--- ext/date/date_core.c	(revision 31948)
+++ ext/date/date_core.c	(revision 31949)
@@ -3483,7 +3483,8 @@
 
     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 @@
 	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;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]