diff options
author | Eric Christopher <echristo@gmail.com> | 2013-07-04 01:10:38 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2013-07-04 01:10:38 +0000 |
commit | c589a5f2849620306b14077b16e51a3e0b7ef5cd (patch) | |
tree | 30f9655e0c82d579e5f1983d703e77b8d755b3bd /lib/Support | |
parent | 2333a31df5eb20db07818252774c3d943d1497d1 (diff) | |
download | external_llvm-c589a5f2849620306b14077b16e51a3e0b7ef5cd.zip external_llvm-c589a5f2849620306b14077b16e51a3e0b7ef5cd.tar.gz external_llvm-c589a5f2849620306b14077b16e51a3e0b7ef5cd.tar.bz2 |
Reapply r185601 with a fix for the cmake build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185605 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Unix/Path.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc index 1cbdbf5..e23e0bd 100644 --- a/lib/Support/Unix/Path.inc +++ b/lib/Support/Unix/Path.inc @@ -626,11 +626,21 @@ error_code permissions(const Twine &path, perms prms) { } error_code setLastModificationAndAccessTime(int FD, TimeValue Time) { +#if defined(HAVE_FUTIMENS) + timespec Times[2]; + Times[0].tv_sec = Time.toPosixTime(); + Times[0].tv_nsec = 0; + Times[1] = Times[0]; + if (::futimens(FD, Times)) +#elif defined(HAVE_FUTIMES) timeval Times[2]; Times[0].tv_sec = Time.toPosixTime(); Times[0].tv_usec = 0; Times[1] = Times[0]; if (::futimes(FD, Times)) +#else +#error Missing futimes() and futimens() +#endif return error_code(errno, system_category()); return error_code::success(); } |