summaryrefslogtreecommitdiffstats
path: root/base/file_util_win.cc
diff options
context:
space:
mode:
authorericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 03:22:48 +0000
committerericu@chromium.org <ericu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-22 03:22:48 +0000
commitf7079e81476fd1549f58815d724533bcb7e0db0f (patch)
treee38fe43a0acf1f379483debe608f9bf055b848af /base/file_util_win.cc
parent41b53ac72fcfe430e816cea48a32bb00e346547f (diff)
downloadchromium_src-f7079e81476fd1549f58815d724533bcb7e0db0f.zip
chromium_src-f7079e81476fd1549f58815d724533bcb7e0db0f.tar.gz
chromium_src-f7079e81476fd1549f58815d724533bcb7e0db0f.tar.bz2
Make DeleteFile succeed on Windows 7 even if the path contains a nonexistent
diretory. BUG=375804 Review URL: https://codereview.chromium.org/296113003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@272071 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_win.cc')
-rw-r--r--base/file_util_win.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index 405a7da..90bc47f 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -94,8 +94,10 @@ bool DeleteFile(const FilePath& path, bool recursive) {
// Some versions of Windows return ERROR_FILE_NOT_FOUND (0x2) when deleting
// an empty directory and some return 0x402 when they should be returning
- // ERROR_FILE_NOT_FOUND. MSDN says Vista and up won't return 0x402.
- return (err == 0 || err == ERROR_FILE_NOT_FOUND || err == 0x402);
+ // ERROR_FILE_NOT_FOUND. MSDN says Vista and up won't return 0x402. Windows 7
+ // can return DE_INVALIDFILES (0x7C) for nonexistent directories.
+ return (err == 0 || err == ERROR_FILE_NOT_FOUND || err == 0x402 ||
+ err == 0x7C);
}
bool DeleteFileAfterReboot(const FilePath& path) {