Index: runtime/bin/file_macos.cc |
diff --git a/runtime/bin/file_macos.cc b/runtime/bin/file_macos.cc |
index c2308b60a71102a8236e6c0a9a33420ed2d4a9d2..3cf40de61fc5267b8221b07b2669f4a38ebc8249 100644 |
--- a/runtime/bin/file_macos.cc |
+++ b/runtime/bin/file_macos.cc |
@@ -208,6 +208,19 @@ bool File::Rename(const char* old_path, const char* new_path) { |
} |
+bool File::RenameLink(const char* old_path, const char* new_path) { |
+ File::Type type = File::GetType(old_path, false); |
+ if (type == kIsLink) { |
+ return TEMP_FAILURE_RETRY(rename(old_path, new_path)) == 0; |
+ } else if (type == kIsDirectory) { |
+ errno = EISDIR; |
+ } else { |
+ errno = EINVAL; |
+ } |
+ return false; |
+} |
+ |
+ |
off_t File::LengthFromPath(const char* name) { |
struct stat st; |
if (TEMP_FAILURE_RETRY(stat(name, &st)) == 0) { |