IOS/ES: Fix DeleteTitle to not use CNANDContentManager
* CNANDContentManager does things that are absolutely useless. In particular, it parses the ticket, the TMD, reads contents, etc. when we only need to remove the title directory. * This means it will fail if the ticket cannot be found, when that should not be the case. * This also obviously caused DeleteTitle to be incredibly inefficient. * We are already removing the title directory later in the function, as CNANDContentManager does not even delete titles correctly. DeleteTitle != DeleteTitleContents.
This commit is contained in:
parent
cc5b5c15ac
commit
3cdb8fd297
|
@ -317,17 +317,16 @@ IPCCommandResult ES::DeleteTitle(const IOCtlVRequest& request)
|
|||
return GetDefaultReply(ES_EINVAL);
|
||||
|
||||
const std::string title_dir = Common::GetTitlePath(title_id, Common::FROM_SESSION_ROOT);
|
||||
if (!File::IsDirectory(title_dir) ||
|
||||
!DiscIO::CNANDContentManager::Access().RemoveTitle(title_id, Common::FROM_SESSION_ROOT))
|
||||
{
|
||||
if (!File::IsDirectory(title_dir))
|
||||
return GetDefaultReply(FS_ENOENT);
|
||||
}
|
||||
|
||||
if (!File::DeleteDirRecursively(title_dir))
|
||||
{
|
||||
ERROR_LOG(IOS_ES, "DeleteTitle: Failed to delete title directory: %s", title_dir.c_str());
|
||||
return GetDefaultReply(FS_EACCESS);
|
||||
}
|
||||
// XXX: ugly, but until we drop CNANDContentManager everywhere, this is going to be needed.
|
||||
DiscIO::CNANDContentManager::Access().ClearCache();
|
||||
|
||||
return GetDefaultReply(IPC_SUCCESS);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue