mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-13 13:25:37 +00:00
Bug 1180901 - Catch the error when trying to remove the trash directory when it contains a file that is locked r=mossop
--HG-- extra : amend_source : feb4bcc17812d4dc2fae99895ff4f6bb6a94ab9f
This commit is contained in:
parent
4076f4a2c1
commit
ec8d23fdb0
@ -7663,9 +7663,17 @@ DirectoryInstallLocation.prototype = {
|
||||
getTrashDir: function DirInstallLocation_getTrashDir() {
|
||||
let trashDir = this._directory.clone();
|
||||
trashDir.append(DIR_TRASH);
|
||||
if (trashDir.exists())
|
||||
recursiveRemove(trashDir);
|
||||
trashDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||
let trashDirExists = trashDir.exists();
|
||||
try {
|
||||
if (trashDirExists)
|
||||
recursiveRemove(trashDir);
|
||||
trashDirExists = false;
|
||||
} catch (e) {
|
||||
logger.warn("Failed to remove trash directory", e);
|
||||
}
|
||||
if (!trashDirExists)
|
||||
trashDir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
|
||||
|
||||
return trashDir;
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user