summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2013-07-04 01:10:38 +0000
committerEric Christopher <echristo@gmail.com>2013-07-04 01:10:38 +0000
commita24dc7fa8c82651be2d74a8f5e09d8fa06e4f3ca (patch)
tree6f2901de47cf6718d2ebeb8169c812c84df3f101 /llvm/lib
parentc87b938e175deb8418865c6e356f6a9fb35620ba (diff)
downloadbcm5719-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.inc10
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();
}
OpenPOWER on IntegriCloud