Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2325)

Unified Diff: base/file_util_win.cc

Issue 296113003: Make DeleteFile succeed on Windows 7 even if the path contains a nonexistent directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed formatting, added unit test Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index adf6608f4e3f16e32238fb46c6b2ae2cbaa5fc04..d9743efbfd3a47b90813fa9e49555969877f99f7 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) {
« no previous file with comments | « base/file_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698