strat: fix remaining FS result magic numbers

This commit is contained in:
Michael Scire 2019-03-28 19:45:41 -07:00
parent acffae6643
commit 29be429d2f
5 changed files with 12 additions and 12 deletions

View file

@ -189,7 +189,7 @@ Result FsMitmService::OpenBisStorage(Out<std::shared_ptr<IStorageInterface>> out
} else { } else {
/* Do not allow non-sysmodules to read *or* write CAL0. */ /* Do not allow non-sysmodules to read *or* write CAL0. */
fsStorageClose(&bis_storage); fsStorageClose(&bis_storage);
return 0x320002; return ResultFsPermissionDenied;
} }
} else { } else {
if (is_sysmodule || has_bis_write_flag) { if (is_sysmodule || has_bis_write_flag) {

View file

@ -237,7 +237,7 @@ bool Utils::IsHidAvailable() {
Result Utils::OpenSdFile(const char *fn, int flags, FsFile *out) { Result Utils::OpenSdFile(const char *fn, int flags, FsFile *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
return fsFsOpenFile(&g_sd_filesystem, fn, flags, out); return fsFsOpenFile(&g_sd_filesystem, fn, flags, out);
@ -245,7 +245,7 @@ Result Utils::OpenSdFile(const char *fn, int flags, FsFile *out) {
Result Utils::OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, FsFile *out) { Result Utils::OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, FsFile *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
char path[FS_MAX_PATH]; char path[FS_MAX_PATH];
@ -259,7 +259,7 @@ Result Utils::OpenSdFileForAtmosphere(u64 title_id, const char *fn, int flags, F
Result Utils::OpenRomFSSdFile(u64 title_id, const char *fn, int flags, FsFile *out) { Result Utils::OpenRomFSSdFile(u64 title_id, const char *fn, int flags, FsFile *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
return OpenRomFSFile(&g_sd_filesystem, title_id, fn, flags, out); return OpenRomFSFile(&g_sd_filesystem, title_id, fn, flags, out);
@ -267,7 +267,7 @@ Result Utils::OpenRomFSSdFile(u64 title_id, const char *fn, int flags, FsFile *o
Result Utils::OpenSdDir(const char *path, FsDir *out) { Result Utils::OpenSdDir(const char *path, FsDir *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
return fsFsOpenDirectory(&g_sd_filesystem, path, FS_DIROPEN_DIRECTORY | FS_DIROPEN_FILE, out); return fsFsOpenDirectory(&g_sd_filesystem, path, FS_DIROPEN_DIRECTORY | FS_DIROPEN_FILE, out);
@ -275,7 +275,7 @@ Result Utils::OpenSdDir(const char *path, FsDir *out) {
Result Utils::OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out) { Result Utils::OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
char safe_path[FS_MAX_PATH]; char safe_path[FS_MAX_PATH];
@ -289,7 +289,7 @@ Result Utils::OpenSdDirForAtmosphere(u64 title_id, const char *path, FsDir *out)
Result Utils::OpenRomFSSdDir(u64 title_id, const char *path, FsDir *out) { Result Utils::OpenRomFSSdDir(u64 title_id, const char *path, FsDir *out) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
return OpenRomFSDir(&g_sd_filesystem, title_id, path, out); return OpenRomFSDir(&g_sd_filesystem, title_id, path, out);
@ -340,7 +340,7 @@ bool Utils::HasSdRomfsContent(u64 title_id) {
Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data, size_t size) { Result Utils::SaveSdFileForAtmosphere(u64 title_id, const char *fn, void *data, size_t size) {
if (!IsSdInitialized()) { if (!IsSdInitialized()) {
return 0xFA202; return ResultFsSdCardNotPresent;
} }
Result rc = 0; Result rc = 0;

View file

@ -62,7 +62,7 @@ static Result GetFileByHandle(FsFile *out, u64 handle) {
*out = g_file_handles[handle]; *out = g_file_handles[handle];
return 0; return 0;
} }
return 0x2EE202; return ResultFsInvalidArgument;
} }
static Result CloseFileByHandle(u64 handle) { static Result CloseFileByHandle(u64 handle) {
@ -72,7 +72,7 @@ static Result CloseFileByHandle(u64 handle) {
g_file_handles.erase(handle); g_file_handles.erase(handle);
return 0; return 0;
} }
return 0x2EE202; return ResultFsInvalidArgument;
} }
static void FixPath(char *dst, size_t dst_size, InBuffer<char> &path) { static void FixPath(char *dst, size_t dst_size, InBuffer<char> &path) {

@ -1 +1 @@
Subproject commit a3ca9cf1a352899b3a4289e210f094997cbacbaf Subproject commit 033c77716cece22ad1ee0d606f75c4659ff4ed76

View file

@ -462,7 +462,7 @@ Result ContentManagement::SetExternalContentSource(u64 tid, FsFileSystem filesys
char mountpoint[32]; char mountpoint[32];
ExternalContentSource::GenerateMountpointName(tid, mountpoint, sizeof(mountpoint)); ExternalContentSource::GenerateMountpointName(tid, mountpoint, sizeof(mountpoint));
if (fsdevMountDevice(mountpoint, filesystem) == -1) { if (fsdevMountDevice(mountpoint, filesystem) == -1) {
return 0x7802; /* specified mount name already exists */ return ResultFsMountNameAlreadyExists;
} }
g_external_content_sources.emplace( g_external_content_sources.emplace(
std::piecewise_construct, std::piecewise_construct,