summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/file_util_win.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index b50ab09..0bd50cb 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -88,7 +88,10 @@ bool Delete(const FilePath& path, bool recursive) {
file_operation.fFlags = FOF_NOERRORUI | FOF_SILENT | FOF_NOCONFIRMATION;
if (!recursive)
file_operation.fFlags |= FOF_NORECURSION | FOF_FILESONLY;
- return (SHFileOperation(&file_operation) == 0);
+ int err = SHFileOperation(&file_operation);
+ // Some versions of Windows return ERROR_FILE_NOT_FOUND when
+ // deleting an empty directory.
+ return (err == 0 || err == ERROR_FILE_NOT_FOUND);
}
bool Move(const FilePath& from_path, const FilePath& to_path) {
@@ -403,7 +406,7 @@ bool CreateTemporaryFileName(FilePath* path) {
return true;
}
- return false;
+ return false;
}
bool CreateTemporaryFileNameInDir(const std::wstring& dir,
@@ -566,8 +569,8 @@ bool RenameFileAndResetSecurityDescriptor(const FilePath& source_file_path,
FOF_NOCONFIRMMKDIR | FOF_NOCOPYSECURITYATTRIBS;
if (0 != SHFileOperation(&move_info))
- return false;
-
+ return false;
+
return true;
}