From 66560d0a7b06203edf1879476da604dfcc1f85bc Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 7 Mar 2019 19:53:21 -0800 Subject: [PATCH] fs.mitm: fix two cases of inverted logic --- stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp | 2 +- stratosphere/ams_mitm/source/utils.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp index 5804a6bfe..40b4b70f6 100644 --- a/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp +++ b/stratosphere/ams_mitm/source/fs_mitm/fsmitm_service.cpp @@ -99,7 +99,7 @@ Result FsMitmService::OpenBisStorage(Out> out FsStorage bis_storage; rc = fsOpenBisStorageFwd(this->forward_service.get(), &bis_storage, bis_partition_id); if (R_SUCCEEDED(rc)) { - const bool is_sysmodule = this->title_id < 0x0100000000001000; + const bool is_sysmodule = this->title_id < 0x0100000000001000ul; const bool has_bis_write_flag = Utils::HasFlag(this->title_id, "bis_write"); const bool has_cal0_read_flag = Utils::HasFlag(this->title_id, "cal_read"); if (bis_partition_id == BisStorageId_Boot0) { diff --git a/stratosphere/ams_mitm/source/utils.cpp b/stratosphere/ams_mitm/source/utils.cpp index 976a82ea9..1f19ede35 100644 --- a/stratosphere/ams_mitm/source/utils.cpp +++ b/stratosphere/ams_mitm/source/utils.cpp @@ -392,14 +392,14 @@ bool Utils::HasTitleFlag(u64 tid, const char *flag) { memset(flag_path, 0, sizeof(flag_path)); snprintf(flag_path, sizeof(flag_path) - 1, "flags/%s.flag", flag); - if (OpenSdFileForAtmosphere(tid, flag_path, FS_OPEN_READ, &f)) { + if (R_SUCCEEDED(OpenSdFileForAtmosphere(tid, flag_path, FS_OPEN_READ, &f))) { fsFileClose(&f); return true; } /* TODO: Deprecate. */ snprintf(flag_path, sizeof(flag_path) - 1, "%s.flag", flag); - if (OpenSdFileForAtmosphere(tid, flag_path, FS_OPEN_READ, &f)) { + if (R_SUCCEEDED(OpenSdFileForAtmosphere(tid, flag_path, FS_OPEN_READ, &f))) { fsFileClose(&f); return true; } @@ -412,7 +412,7 @@ bool Utils::HasGlobalFlag(const char *flag) { FsFile f; char flag_path[FS_MAX_PATH] = {0}; snprintf(flag_path, sizeof(flag_path), "/atmosphere/flags/%s.flag", flag); - if (fsFsOpenFile(&g_sd_filesystem, flag_path, FS_OPEN_READ, &f)) { + if (R_SUCCEEDED(fsFsOpenFile(&g_sd_filesystem, flag_path, FS_OPEN_READ, &f))) { fsFileClose(&f); return true; }