summaryrefslogtreecommitdiff
path: root/lib/Support/Unix
diff options
context:
space:
mode:
authorAlp Toker <alp@nuanti.com>2013-12-11 15:42:33 +0000
committerAlp Toker <alp@nuanti.com>2013-12-11 15:42:33 +0000
commit00a9489ff302c6c92689c96ebd7585a1a74edbea (patch)
tree9cdb2e7793fec05c26d05cbf37aa2dc944c36fe5 /lib/Support/Unix
parent3bf51cf30293272198515bfe315db1dd81d86e63 (diff)
downloadllvm-00a9489ff302c6c92689c96ebd7585a1a74edbea.tar.gz
llvm-00a9489ff302c6c92689c96ebd7585a1a74edbea.tar.bz2
llvm-00a9489ff302c6c92689c96ebd7585a1a74edbea.tar.xz
Build fix for Android NDK which has neither futimes nor futimens
Based on a patch by Neil Henning! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/Unix')
-rw-r--r--lib/Support/Unix/Path.inc9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Support/Unix/Path.inc b/lib/Support/Unix/Path.inc
index 734ea5d110..d526042461 100644
--- a/lib/Support/Unix/Path.inc
+++ b/lib/Support/Unix/Path.inc
@@ -531,17 +531,20 @@ error_code setLastModificationAndAccessTime(int FD, TimeValue Time) {
Times[0].tv_nsec = 0;
Times[1] = Times[0];
if (::futimens(FD, Times))
+ return error_code(errno, system_category());
+ return error_code::success();
#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();
+#else
+#warning Missing futimes() and futimens()
+ return make_error_code(errc::not_supported);
+#endif
}
error_code mapped_file_region::init(int FD, bool CloseFD, uint64_t Offset) {