Index: base/file_util_win.cc |
diff --git a/base/file_util_win.cc b/base/file_util_win.cc |
index f538c20c4f847ae243873e65a333dc367bf9065a..03a76fb56763f7b799266cdffebcfed21fd5f752 100644 |
--- a/base/file_util_win.cc |
+++ b/base/file_util_win.cc |
@@ -200,9 +200,18 @@ bool ReplaceFile(const FilePath& from_path, const FilePath& to_path) { |
::CloseHandle(target_file); |
// When writing to a network share, we may not be able to change the ACLs. |
// Ignore ACL errors then (REPLACEFILE_IGNORE_MERGE_ERRORS). |
- return ::ReplaceFile(to_path.value().c_str(), |
+ BOOL replaced = ::ReplaceFile(to_path.value().c_str(), |
from_path.value().c_str(), NULL, |
- REPLACEFILE_IGNORE_MERGE_ERRORS, NULL, NULL) ? true : false; |
+ REPLACEFILE_IGNORE_MERGE_ERRORS, NULL, NULL); |
+ |
+ if (!replaced) { |
+ DWORD replace_error = ::GetLastError(); |
+ DLOG(WARNING) << "Unable to replace file \"" << from_path.value() |
+ << "\" with \"" << to_path.value() |
+ << "\", error = " << replace_error |
+ << " (" << win_util::FormatMessage(replace_error) << ")"; |
+ } |
+ return replaced ? true : false; |
} |
bool CopyFile(const FilePath& from_path, const FilePath& to_path) { |