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

Unified Diff: base/time_posix.cc

Issue 13818027: posix: replace nonstandard futimes call with futimens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: change Time::ToTimeVal to Time::ToTimeSpec Created 7 years, 8 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
« base/time.h ('K') | « base/time.h ('k') | base/time_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time_posix.cc
diff --git a/base/time_posix.cc b/base/time_posix.cc
index 288c646309f9682335e1ef9496b1d632fbf88948..1f8a9093e08ce9bcf4242342ff4431e6da7dd93f 100644
--- a/base/time_posix.cc
+++ b/base/time_posix.cc
@@ -305,21 +305,21 @@ Time Time::FromTimeVal(struct timeval t) {
kTimeTToMicrosecondsOffset);
}
-struct timeval Time::ToTimeVal() const {
- struct timeval result;
+struct timespec Time::ToTimeSpec() const {
+ struct timespec result;
if (is_null()) {
result.tv_sec = 0;
- result.tv_usec = 0;
+ result.tv_nsec = 0;
return result;
}
if (is_max()) {
result.tv_sec = std::numeric_limits<time_t>::max();
- result.tv_usec = static_cast<suseconds_t>(Time::kMicrosecondsPerSecond) - 1;
+ result.tv_nsec = static_cast<long>(Time::kNanosecondsPerSecond) - 1;
return result;
}
int64 us = us_ - kTimeTToMicrosecondsOffset;
result.tv_sec = us / Time::kMicrosecondsPerSecond;
- result.tv_usec = us % Time::kMicrosecondsPerSecond;
+ result.tv_nsec = (us % Time::kMicrosecondsPerSecond) * 1000;
return result;
}
« base/time.h ('K') | « base/time.h ('k') | base/time_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698