Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: chrome/browser/renderer_host/render_sandbox_host_linux.cc

Issue 159216: Linux: add support for tm_zone to localtime via the sandbox. (Closed)
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/zygote_main_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_sandbox_host_linux.cc
diff --git a/chrome/browser/renderer_host/render_sandbox_host_linux.cc b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
index f7ca1451d27ebd00ac06553bc74e9fa9910960b9..7a9356b3fee668382a7185d61c980d5c98e70cf1 100644
--- a/chrome/browser/renderer_host/render_sandbox_host_linux.cc
+++ b/chrome/browser/renderer_host/render_sandbox_host_linux.cc
@@ -296,14 +296,16 @@ class SandboxIPCProcess : public WebKitClient {
time_t time;
memcpy(&time, time_string.data(), sizeof(time));
- struct tm expanded_time;
- localtime_r(&time, &expanded_time);
+ // We use localtime here because we need the tm_zone field to be filled
+ // out. Since we are a single-threaded process, this is safe.
+ const struct tm* expanded_time = localtime(&time);
- const std::string result_string(reinterpret_cast<char*>(&expanded_time),
- sizeof(expanded_time));
+ const std::string result_string(reinterpret_cast<const char*>(expanded_time),
tony 2009/07/22 20:01:41 Nit: 80 cols.
+ sizeof(struct tm));
Pickle reply;
reply.WriteString(result_string);
+ reply.WriteString(expanded_time->tm_zone);
SendRendererReply(fds, reply, -1);
}
« no previous file with comments | « no previous file | chrome/browser/zygote_main_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698