Chromium Code Reviews| Index: base/file_util_posix.cc |
| diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc |
| index 8b368127410e091eb392cf440f2bd9c50a417acd..97919ffdf055a92254879400f247e3ad5b4949a4 100644 |
| --- a/base/file_util_posix.cc |
| +++ b/base/file_util_posix.cc |
| @@ -232,9 +232,17 @@ 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) { |
| + if (error) |
| + *error = base::PLATFORM_FILE_OK; |
| 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) { |
| + if (error) |
| + *error = base::ErrnoToPlatformFileError(errno); |
| + return false; |
| + } |
| + return true; |
|
jar (doing other things)
2013/05/07 01:12:36
nit: switch the order of the results around, and y
|
| } |
| bool CopyDirectory(const FilePath& from_path, |