mirror of
https://github.com/darlinghq/darling-libcxx.git
synced 2024-12-14 23:38:28 +00:00
Remove Apple specific guard for utimensat. Use !defined(UTIME_OMIT) instead.
As pointed out by @majnemer this is a better way to detect utimensat on all platforms. The Apple specific guard is unneeded. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@273093 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d9bca8ab7d
commit
2730c251ae
@ -19,7 +19,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
#include <fcntl.h> /* values for fchmodat */
|
#include <fcntl.h> /* values for fchmodat */
|
||||||
#if defined(__APPLE__)
|
#if !defined(UTIME_OMIT)
|
||||||
#include <sys/time.h> // for ::utimes as used in __last_write_time
|
#include <sys/time.h> // for ::utimes as used in __last_write_time
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -507,10 +507,9 @@ void __last_write_time(const path& p, file_time_type new_time,
|
|||||||
using namespace std::chrono;
|
using namespace std::chrono;
|
||||||
std::error_code m_ec;
|
std::error_code m_ec;
|
||||||
|
|
||||||
// We can use the presence of UTIME_OMIT to detect GLIBC versions that
|
// We can use the presence of UTIME_OMIT to detect platforms that do not
|
||||||
// do not provide utimensat.
|
// provide utimensat.
|
||||||
// FIXME: Use utimensat when it becomes available on OS X.
|
#if !defined(UTIME_OMIT)
|
||||||
#if defined(__APPLE__) || !defined(UTIME_OMIT)
|
|
||||||
// This implementation has a race condition between determining the
|
// This implementation has a race condition between determining the
|
||||||
// last access time and attempting to set it to the same value using
|
// last access time and attempting to set it to the same value using
|
||||||
// ::utimes
|
// ::utimes
|
||||||
|
Loading…
Reference in New Issue
Block a user