summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2015-04-09 14:45:17 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2015-04-09 14:45:17 +0000
commita6600a974a7bf8b5b7afab68632322806b51d051 (patch)
tree10c44a6e5400043c8e06326bda117e945d886c87 /compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
parent6759d124e77baa591061a2ef688d8ba6ce6ba557 (diff)
downloadbcm5719-llvm-a6600a974a7bf8b5b7afab68632322806b51d051.tar.gz
bcm5719-llvm-a6600a974a7bf8b5b7afab68632322806b51d051.zip
Use RenameFile instead of internal_rename in non-POSIX code
llvm-svn: 234490
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_posix.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_posix.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
index 1b0f25a88f1..f3ae613de5c 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
@@ -243,6 +243,11 @@ bool WriteToFile(fd_t fd, const void *buff, uptr buff_size, uptr *bytes_written,
return true;
}
+bool RenameFile(const char *oldpath, const char *newpath, error_t *error_p) {
+ uptr res = internal_rename(oldpath, newpath);
+ return !internal_iserror(res, error_p);
+}
+
void *MapFileToMemory(const char *file_name, uptr *buff_size) {
fd_t fd = OpenFile(file_name, RdOnly);
CHECK(fd != kInvalidFd);
OpenPOWER on IntegriCloud