summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
diff options
context:
space:
mode:
authordkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 19:05:54 +0000
committerdkegel@google.com <dkegel@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 19:05:54 +0000
commitbd05da2be472b05c290261fbf99a4a3673982a7f (patch)
treeaa26a46604c8618e8cc5a00cc374a26db4422b8d /base/file_util_win.cc
parent2c62b561f63579ac835af49ba233c56ca03417ca (diff)
downloadchromium_src-bd05da2be472b05c290261fbf99a4a3673982a7f.zip
chromium_src-bd05da2be472b05c290261fbf99a4a3673982a7f.tar.gz
chromium_src-bd05da2be472b05c290261fbf99a4a3673982a7f.tar.bz2
FileUtilTest.Contains failed on Vista Home 64 (and wine)
because deleting an empty directory tree fails there with ERROR_FILE_NOT_FOUND, so allow that return value. Review URL: http://codereview.chromium.org/18830 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8733 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-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;
}