summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-07 01:12:20 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-07 01:12:20 (GMT)
commit46e4dcf09d288c0771c4aa4bae9babb21e89bf58 (patch)
treeab2be4f4d867d1616a11a8f11acd8a2cd60b7235
parentac6eedd93287969bfc215ae0645b76d75c0ade45 (diff)
merge revision(s) 18355:
* eval.c (timeofday): use monotonic clock. based on a patch from zimbatm <zimbatm@oree.ch> in [ruby-core:16627]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--configure.in1
-rw-r--r--eval.c9
-rw-r--r--version.h8
4 files changed, 19 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 8c6e793..cc0669a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Jan 7 10:09:46 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (timeofday): use monotonic clock. based on a patch
+ from zimbatm <zimbatm@oree.ch> in [ruby-core:16627].
+
Tue Jan 6 09:03:35 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (yylex): 8 and 9 in octal integer should cause compile
diff --git a/configure.in b/configure.in
index 05b0639..5633bc3 100644
--- a/configure.in
+++ b/configure.in
@@ -501,6 +501,7 @@ esac
AC_CHECK_LIB(crypt, crypt)
AC_CHECK_LIB(dl, dlopen) # Dynamic linking for SunOS/Solaris and SYSV
AC_CHECK_LIB(dld, shl_load) # Dynamic linking for HP-UX
+AC_CHECK_LIB(rt, clock_gettime) # GNU/Linux
case "$target_cpu" in
alpha*) case "$target_os"::"$GCC" in
diff --git a/eval.c b/eval.c
index 5aa3009..d2a2556 100644
--- a/eval.c
+++ b/eval.c
@@ -72,6 +72,8 @@ char *strrchr _((const char*,const char));
#include <unistd.h>
#endif
+#include <time.h>
+
#ifdef __BEOS__
#include <net/socket.h>
#endif
@@ -10363,6 +10365,13 @@ static double
timeofday()
{
struct timeval tv;
+#ifdef CLOCK_MONOTONIC
+ struct timespec tp;
+
+ if (clock_gettime(CLOCK_MONOTONIC, &tp) == 0) {
+ return (double)tp.tv_sec + (double)tp.tv_nsec * 1e-9;
+ }
+#endif
gettimeofday(&tv, NULL);
return (double)tv.tv_sec + (double)tv.tv_usec * 1e-6;
}
diff --git a/version.h b/version.h
index 4535dd4..76b4252 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2009-01-06"
+#define RUBY_RELEASE_DATE "2009-01-07"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20090106
-#define RUBY_PATCHLEVEL 78
+#define RUBY_RELEASE_CODE 20090107
+#define RUBY_PATCHLEVEL 79
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 6
+#define RUBY_RELEASE_DAY 7
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];