Index: runtime/bin/file_android.cc |
diff --git a/runtime/bin/file_android.cc b/runtime/bin/file_android.cc |
index 513f96ef6359201d95db76c824f6e83661a5ebdb..9b5ff1b17d3ba2a7d66a3ab79e2bb4ada1901351 100644 |
--- a/runtime/bin/file_android.cc |
+++ b/runtime/bin/file_android.cc |
@@ -205,6 +205,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) { |