mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-02 17:29:03 +00:00
[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
This commit is contained in:
parent
0a4bdea033
commit
e5a3ac2b97
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user