mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-26 00:17:47 -10:00
Bug 1007797 - Save ctypes.winLastError to prevent WinFile.GetFileAttributes from clobbering it. r=yoric
This commit is contained in:
1 parent
69a554f909
commit
12242164d0
1 file changed
+6
-2
@@ -414,9 +414,13 @@
|
||||
return;
|
||||
}
|
||||
} else if (ctypes.winLastError == Const.ERROR_ACCESS_DENIED) {
|
||||
// Save winLastError before another ctypes call.
|
||||
let lastError = ctypes.winLastError;
|
||||
let attributes = WinFile.GetFileAttributes(path);
|
||||
if (attributes != Const.INVALID_FILE_ATTRIBUTES &&
|
||||
attributes & Const.FILE_ATTRIBUTE_READONLY) {
|
||||
if (attributes != Const.INVALID_FILE_ATTRIBUTES) {
|
||||
if (!(attributes & Const.FILE_ATTRIBUTE_READONLY)) {
|
||||
throw new File.Error("remove", lastError, path);
|
||||
}
|
||||
let newAttributes = attributes & ~Const.FILE_ATTRIBUTE_READONLY;
|
||||
if (WinFile.SetFileAttributes(path, newAttributes) &&
|
||||
WinFile.DeleteFile(path)) {
|
||||
|
||||
Reference in new issue
Block a user