| Index: runtime/bin/file_linux.cc
|
| diff --git a/runtime/bin/file_linux.cc b/runtime/bin/file_linux.cc
|
| index 840e6b96c8ef1471ddd782b01a433443c502be13..b45ce046a79597b8ea0087297ab49b0b394377c0 100644
|
| --- a/runtime/bin/file_linux.cc
|
| +++ b/runtime/bin/file_linux.cc
|
| @@ -206,6 +206,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) {
|
|
|