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 | a24dc7fa8c82651be2d74a8f5e09d8fa06e4f3ca (patch) | |
tree | 6f2901de47cf6718d2ebeb8169c812c84df3f101 /llvm/lib | |
parent | c87b938e175deb8418865c6e356f6a9fb35620ba (diff) | |
download | bcm5719-llvm-a24dc7fa8c82651be2d74a8f5e09d8fa06e4f3ca.tar.gz bcm5719-llvm-a24dc7fa8c82651be2d74a8f5e09d8fa06e4f3ca.zip |
Reapply r185601 with a fix for the cmake build.
llvm-svn: 185605
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Support/Unix/Path.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc index 1cbdbf5429b..e23e0bd6186 100644 --- a/llvm/lib/Support/Unix/Path.inc +++ b/llvm/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(); } |