* src/native/vm/nativevm.cpp (nativevm_preinit): Sanity check current time.
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 4 Nov 2009 10:52:06 +0000 (11:52 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 4 Nov 2009 10:52:06 +0000 (11:52 +0100)
src/native/vm/nativevm.cpp

index 1894c9019364c15b27b5876015a5948d5e8b8612..6ad36aa861aa5ef988b8d0217ae86e7cec0d270b 100644 (file)
@@ -127,6 +127,13 @@ void nativevm_preinit(void)
        _Jv_sun_misc_Perf_init();
        _Jv_sun_misc_Unsafe_init();
 
+#  if !defined(NDEBUG)
+       // Sanity check current time in milliseconds, because negative values
+       // might confuse OpenJDKs sanity checks.
+       if (opt_PrintWarnings && (builtin_currenttimemillis() < 0))
+               log_println("nativevm_preinit: Current time in milliseconds is negative, please check your time!");
+#  endif
+
 # else
 #  error unknown classpath configuration
 # endif