mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-25 04:56:13 +08:00
Use utimes instead of utimensat when !defined(UTIME_OMIT). Fixes build for older GLIBC versions
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273088 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user