diff options
author | Pavel Labath <labath@google.com> | 2016-10-24 14:19:28 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-10-24 14:19:28 +0000 |
commit | 676a875b06d394fa9295c690de39dff9c5f5430e (patch) | |
tree | af3c00bc035bd74e89cd182f8ea4eac7b11b28df /llvm/lib/Support/Unix | |
parent | 183098ca47e1e4e7dde11e0ea92dd0f64c32a5f0 (diff) | |
download | bcm5719-llvm-676a875b06d394fa9295c690de39dff9c5f5430e.tar.gz bcm5719-llvm-676a875b06d394fa9295c690de39dff9c5f5430e.zip |
[Chrono] Fix !HAVE_FUTIMENS build
If we don't have futimens(), we fall back to futimes(), which only supports
microsecond timestamps. In that case, we need to explicitly cast away the extra
precision in setLastModificationAndAccessTime().
llvm-svn: 284977
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index d1d0c5d2694..881a2631ec0 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/lib/Support/Unix/Path.inc @@ -451,7 +451,8 @@ std::error_code setLastModificationAndAccessTime(int FD, TimePoint<> Time) { return std::error_code(); #elif defined(HAVE_FUTIMES) timeval Times[2]; - Times[0] = Times[1] = sys::toTimeVal(Time); + Times[0] = Times[1] = sys::toTimeVal( + std::chrono::time_point_cast<std::chrono::microseconds>(Time)); if (::futimes(FD, Times)) return std::error_code(errno, std::generic_category()); return std::error_code(); |