diff options
author | Eric Fiselier <eric@efcs.ca> | 2016-06-18 17:37:04 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2016-06-18 17:37:04 +0000 |
commit | d9ed9c462b62fdf374e809a14ce1ada2b7653c06 (patch) | |
tree | 4ccd154311d625e4b25782a23d03f336acecf8e1 /libcxx/src/experimental/filesystem/operations.cpp | |
parent | b2016787637860b16832c67ec5f448d3084f17a0 (diff) | |
download | bcm5719-llvm-d9ed9c462b62fdf374e809a14ce1ada2b7653c06.tar.gz bcm5719-llvm-d9ed9c462b62fdf374e809a14ce1ada2b7653c06.zip |
Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for older GLIBC versions
llvm-svn: 273088
Diffstat (limited to 'libcxx/src/experimental/filesystem/operations.cpp')
-rw-r--r-- | libcxx/src/experimental/filesystem/operations.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/src/experimental/filesystem/operations.cpp b/libcxx/src/experimental/filesystem/operations.cpp index f92b0f7bac1..ebaadf4044e 100644 --- a/libcxx/src/experimental/filesystem/operations.cpp +++ b/libcxx/src/experimental/filesystem/operations.cpp @@ -507,8 +507,10 @@ void __last_write_time(const path& p, file_time_type new_time, using namespace std::chrono; std::error_code m_ec; -#if defined(__APPLE__) + // We can use the presence of UTIME_OMIT to detect GLIBC versions that + // do not provide utimensat. // FIXME: Use utimensat when it becomes available on OS X. +#if defined(__APPLE__) || !defined(UTIME_OMIT) // This implementation has a race condition between determining the // last access time and attempting to set it to the same value using // ::utimes |