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) { |