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

Unified Diff: base/platform_file_posix.cc

Issue 13818027: posix: replace nonstandard futimes call with futimens (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/platform_file_posix.cc
diff --git a/base/platform_file_posix.cc b/base/platform_file_posix.cc
index 646c82e8dfd2ec74e6a600a4874f191f360776e9..b9bb1805ecc499b8a203d028e2b99f5463972244 100644
--- a/base/platform_file_posix.cc
+++ b/base/platform_file_posix.cc
@@ -298,10 +298,17 @@ bool TouchPlatformFile(PlatformFile file, const base::Time& last_access_time,
if (file < 0)
return false;
- timeval times[2];
- times[0] = last_access_time.ToTimeVal();
- times[1] = last_modified_time.ToTimeVal();
- return !futimes(file, times);
+ timeval tv[2];
+ tv[0] = last_access_time.ToTimeVal();
darin (slow to review) 2013/04/10 17:51:05 nit: The code might be more readable with named va
Mostyn Bramley-Moore 2013/04/10 20:59:07 Done.
+ tv[1] = last_modified_time.ToTimeVal();
+
+ timespec ts[2];
+ ts[0].tv_sec = tv[0].tv_sec;
+ ts[0].tv_nsec = tv[0].tv_usec * 1000;
+ ts[1].tv_sec = tv[1].tv_sec;
+ ts[1].tv_nsec = tv[1].tv_usec * 1000;
+
+ return !futimens(file, ts);
}
bool GetPlatformFileInfo(PlatformFile file, PlatformFileInfo* info) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698