[v8] r12802 committed - Use correct timezone information on Solaris...

5 views
Skip to first unread message

codesite...@google.com

unread,
Oct 23, 2012, 9:04:14 AM10/23/12
to v8-...@googlegroups.com
Revision: 12802
Author: yan...@chromium.org
Date: Tue Oct 23 06:04:05 2012
Log: Use correct timezone information on Solaris

`timezone` variable contains the difference, in seconds, between UTC and
local standard time (see `man 3 localtime` on Solaris).

Call to `tzset` is required to apply contents of `TZ` variable to
`timezone` variable.

BUG=v8:2064

Review URL: https://chromiumcodereview.appspot.com/10967066
Patch from Maciej Małecki <m...@mmalecki.com>.
http://code.google.com/p/v8/source/detail?r=12802

Modified:
/branches/bleeding_edge/src/platform-solaris.cc

=======================================
--- /branches/bleeding_edge/src/platform-solaris.cc Mon Oct 22 09:33:10 2012
+++ /branches/bleeding_edge/src/platform-solaris.cc Tue Oct 23 06:04:05 2012
@@ -125,12 +125,8 @@


double OS::LocalTimeOffset() {
- // On Solaris, struct tm does not contain a tm_gmtoff field.
- time_t utc = time(NULL);
- ASSERT(utc != -1);
- struct tm* loc = localtime(&utc);
- ASSERT(loc != NULL);
- return static_cast<double>((mktime(loc) - utc) * msPerSecond);
+ tzset();
+ return -static_cast<double>(timezone * msPerSecond);
}


Reply all
Reply to author
Forward
0 new messages