fs.mitm: Fix romfs detection on SD

This commit is contained in:
Michael Scire 2018-11-04 12:48:14 -08:00
parent e786bc7e9a
commit 5d0aabaa44

View File

@ -202,6 +202,14 @@ Result Utils::OpenRomFSDir(FsFileSystem *fs, u64 title_id, const char *path, FsD
} }
bool Utils::HasSdRomfsContent(u64 title_id) { bool Utils::HasSdRomfsContent(u64 title_id) {
/* Check for romfs.bin. */
FsFile data_file;
if (R_SUCCEEDED(Utils::OpenSdFileForAtmosphere(title_id, "romfs.bin", FS_OPEN_READ, &data_file))) {
fsFileClose(&data_file);
return true;
}
/* Check for romfs folder with non-zero content. */
FsDir dir; FsDir dir;
if (R_FAILED(Utils::OpenRomFSSdDir(title_id, "", &dir))) { if (R_FAILED(Utils::OpenRomFSSdDir(title_id, "", &dir))) {
return false; return false;