Index: base/file_util_posix.cc |
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc |
index 8b368127410e091eb392cf440f2bd9c50a417acd..b3bb27d1e8a6a93aa454a122a93939757a6b818d 100644 |
--- a/base/file_util_posix.cc |
+++ b/base/file_util_posix.cc |
@@ -232,9 +232,14 @@ bool MoveUnsafe(const FilePath& from_path, const FilePath& to_path) { |
return true; |
} |
-bool ReplaceFile(const FilePath& from_path, const FilePath& to_path) { |
+bool ReplaceFile(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, |