Index: base/file_util_posix.cc |
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc |
index 8b368127410e091eb392cf440f2bd9c50a417acd..7ef09a200de29c96c1f3f49e7002e50798488ec0 100644 |
--- a/base/file_util_posix.cc |
+++ b/base/file_util_posix.cc |
@@ -232,9 +232,15 @@ bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) { |
return true; |
} |
-bool ReplaceFile(const FilePath& from_path, const FilePath& to_path) { |
+bool ReplaceFileAndGetError(const FilePath& from_path, |
+ const FilePath& to_path, |
+ base::PlatformFileError* error) { |
base::ThreadRestrictions::AssertIOAllowed(); |
- return (rename(from_path.value().c_str(), to_path.value().c_str()) == 0); |
+ if (rename(from_path.value().c_str(), to_path.value().c_str()) == 0) |
+ return true; |
+ if (error) |
+ *error = base::ErrnoToPlatformFileError(errno); |
+ return false; |
} |
bool CopyDirectory(const FilePath& from_path, |