summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar FearlessTobi2024-01-18 21:55:15 +0100
committerGravatar Liam2024-01-25 16:42:06 -0500
commitc60ab6bbf61021e247c2574a771d3d88a77ed398 (patch)
tree27e6b6b5d6afaabb7c6d1ba93ad63f140a70a65c
parentfs: Replace Mode enum by OpenMode enum (diff)
downloadyuzu-c60ab6bbf61021e247c2574a771d3d88a77ed398.tar.gz
yuzu-c60ab6bbf61021e247c2574a771d3d88a77ed398.tar.xz
yuzu-c60ab6bbf61021e247c2574a771d3d88a77ed398.zip
fs/errors: Unify naming of result codes
-rw-r--r--src/core/file_sys/errors.h15
-rw-r--r--src/core/hle/service/filesystem/filesystem.cpp38
-rw-r--r--src/core/hle/service/filesystem/fsp/fs_i_file.cpp8
-rw-r--r--src/core/hle/service/filesystem/fsp/fs_i_storage.cpp4
-rw-r--r--src/core/hle/service/filesystem/fsp/fsp_srv.cpp4
-rw-r--r--src/core/hle/service/filesystem/save_data_controller.cpp6
-rw-r--r--src/core/hle/service/set/system_settings_server.cpp4
7 files changed, 37 insertions, 42 deletions
diff --git a/src/core/file_sys/errors.h b/src/core/file_sys/errors.h
index 2f5045a67..7134445cf 100644
--- a/src/core/file_sys/errors.h
+++ b/src/core/file_sys/errors.h
@@ -7,18 +7,13 @@
7 7
8namespace FileSys { 8namespace FileSys {
9 9
10constexpr Result ERROR_PATH_NOT_FOUND{ErrorModule::FS, 1}; 10constexpr Result ResultPathNotFound{ErrorModule::FS, 1};
11constexpr Result ERROR_PATH_ALREADY_EXISTS{ErrorModule::FS, 2}; 11constexpr Result ResultPathAlreadyExists{ErrorModule::FS, 2};
12constexpr Result ERROR_ENTITY_NOT_FOUND{ErrorModule::FS, 1002};
13constexpr Result ERROR_SD_CARD_NOT_FOUND{ErrorModule::FS, 2001};
14constexpr Result ERROR_OUT_OF_BOUNDS{ErrorModule::FS, 3005};
15constexpr Result ERROR_FAILED_MOUNT_ARCHIVE{ErrorModule::FS, 3223};
16constexpr Result ERROR_INVALID_ARGUMENT{ErrorModule::FS, 6001};
17constexpr Result ERROR_INVALID_OFFSET{ErrorModule::FS, 6061};
18constexpr Result ERROR_INVALID_SIZE{ErrorModule::FS, 6062};
19
20constexpr Result ResultUnsupportedSdkVersion{ErrorModule::FS, 50}; 12constexpr Result ResultUnsupportedSdkVersion{ErrorModule::FS, 50};
21constexpr Result ResultPartitionNotFound{ErrorModule::FS, 1001}; 13constexpr Result ResultPartitionNotFound{ErrorModule::FS, 1001};
14constexpr Result ResultTargetNotFound{ErrorModule::FS, 1002};
15constexpr Result ResultPortSdCardNoDevice{ErrorModule::FS, 2001};
16constexpr Result ResultNotImplemented{ErrorModule::FS, 3001};
22constexpr Result ResultUnsupportedVersion{ErrorModule::FS, 3002}; 17constexpr Result ResultUnsupportedVersion{ErrorModule::FS, 3002};
23constexpr Result ResultOutOfRange{ErrorModule::FS, 3005}; 18constexpr Result ResultOutOfRange{ErrorModule::FS, 3005};
24constexpr Result ResultAllocationMemoryFailedInFileSystemBuddyHeapA{ErrorModule::FS, 3294}; 19constexpr Result ResultAllocationMemoryFailedInFileSystemBuddyHeapA{ErrorModule::FS, 3294};
diff --git a/src/core/hle/service/filesystem/filesystem.cpp b/src/core/hle/service/filesystem/filesystem.cpp
index eb8c3c23e..ae230afc0 100644
--- a/src/core/hle/service/filesystem/filesystem.cpp
+++ b/src/core/hle/service/filesystem/filesystem.cpp
@@ -52,12 +52,12 @@ Result VfsDirectoryServiceWrapper::CreateFile(const std::string& path_, u64 size
52 std::string path(Common::FS::SanitizePath(path_)); 52 std::string path(Common::FS::SanitizePath(path_));
53 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 53 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
54 if (dir == nullptr) { 54 if (dir == nullptr) {
55 return FileSys::ERROR_PATH_NOT_FOUND; 55 return FileSys::ResultPathNotFound;
56 } 56 }
57 57
58 FileSys::DirectoryEntryType entry_type{}; 58 FileSys::DirectoryEntryType entry_type{};
59 if (GetEntryType(&entry_type, path) == ResultSuccess) { 59 if (GetEntryType(&entry_type, path) == ResultSuccess) {
60 return FileSys::ERROR_PATH_ALREADY_EXISTS; 60 return FileSys::ResultPathAlreadyExists;
61 } 61 }
62 62
63 auto file = dir->CreateFile(Common::FS::GetFilename(path)); 63 auto file = dir->CreateFile(Common::FS::GetFilename(path));
@@ -81,7 +81,7 @@ Result VfsDirectoryServiceWrapper::DeleteFile(const std::string& path_) const {
81 81
82 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 82 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
83 if (dir == nullptr || dir->GetFile(Common::FS::GetFilename(path)) == nullptr) { 83 if (dir == nullptr || dir->GetFile(Common::FS::GetFilename(path)) == nullptr) {
84 return FileSys::ERROR_PATH_NOT_FOUND; 84 return FileSys::ResultPathNotFound;
85 } 85 }
86 if (!dir->DeleteFile(Common::FS::GetFilename(path))) { 86 if (!dir->DeleteFile(Common::FS::GetFilename(path))) {
87 // TODO(DarkLordZach): Find a better error code for this 87 // TODO(DarkLordZach): Find a better error code for this
@@ -152,12 +152,12 @@ Result VfsDirectoryServiceWrapper::RenameFile(const std::string& src_path_,
152 if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) { 152 if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) {
153 // Use more-optimized vfs implementation rename. 153 // Use more-optimized vfs implementation rename.
154 if (src == nullptr) { 154 if (src == nullptr) {
155 return FileSys::ERROR_PATH_NOT_FOUND; 155 return FileSys::ResultPathNotFound;
156 } 156 }
157 157
158 if (dst && Common::FS::Exists(dst->GetFullPath())) { 158 if (dst && Common::FS::Exists(dst->GetFullPath())) {
159 LOG_ERROR(Service_FS, "File at new_path={} already exists", dst->GetFullPath()); 159 LOG_ERROR(Service_FS, "File at new_path={} already exists", dst->GetFullPath());
160 return FileSys::ERROR_PATH_ALREADY_EXISTS; 160 return FileSys::ResultPathAlreadyExists;
161 } 161 }
162 162
163 if (!src->Rename(Common::FS::GetFilename(dest_path))) { 163 if (!src->Rename(Common::FS::GetFilename(dest_path))) {
@@ -194,7 +194,7 @@ Result VfsDirectoryServiceWrapper::RenameDirectory(const std::string& src_path_,
194 if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) { 194 if (Common::FS::GetParentPath(src_path) == Common::FS::GetParentPath(dest_path)) {
195 // Use more-optimized vfs implementation rename. 195 // Use more-optimized vfs implementation rename.
196 if (src == nullptr) 196 if (src == nullptr)
197 return FileSys::ERROR_PATH_NOT_FOUND; 197 return FileSys::ResultPathNotFound;
198 if (!src->Rename(Common::FS::GetFilename(dest_path))) { 198 if (!src->Rename(Common::FS::GetFilename(dest_path))) {
199 // TODO(DarkLordZach): Find a better error code for this 199 // TODO(DarkLordZach): Find a better error code for this
200 return ResultUnknown; 200 return ResultUnknown;
@@ -223,7 +223,7 @@ Result VfsDirectoryServiceWrapper::OpenFile(FileSys::VirtualFile* out_file,
223 223
224 auto file = backing->GetFileRelative(npath); 224 auto file = backing->GetFileRelative(npath);
225 if (file == nullptr) { 225 if (file == nullptr) {
226 return FileSys::ERROR_PATH_NOT_FOUND; 226 return FileSys::ResultPathNotFound;
227 } 227 }
228 228
229 if (mode == FileSys::OpenMode::AllowAppend) { 229 if (mode == FileSys::OpenMode::AllowAppend) {
@@ -241,7 +241,7 @@ Result VfsDirectoryServiceWrapper::OpenDirectory(FileSys::VirtualDir* out_direct
241 auto dir = GetDirectoryRelativeWrapped(backing, path); 241 auto dir = GetDirectoryRelativeWrapped(backing, path);
242 if (dir == nullptr) { 242 if (dir == nullptr) {
243 // TODO(DarkLordZach): Find a better error code for this 243 // TODO(DarkLordZach): Find a better error code for this
244 return FileSys::ERROR_PATH_NOT_FOUND; 244 return FileSys::ResultPathNotFound;
245 } 245 }
246 *out_directory = dir; 246 *out_directory = dir;
247 return ResultSuccess; 247 return ResultSuccess;
@@ -252,7 +252,7 @@ Result VfsDirectoryServiceWrapper::GetEntryType(FileSys::DirectoryEntryType* out
252 std::string path(Common::FS::SanitizePath(path_)); 252 std::string path(Common::FS::SanitizePath(path_));
253 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 253 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
254 if (dir == nullptr) { 254 if (dir == nullptr) {
255 return FileSys::ERROR_PATH_NOT_FOUND; 255 return FileSys::ResultPathNotFound;
256 } 256 }
257 257
258 auto filename = Common::FS::GetFilename(path); 258 auto filename = Common::FS::GetFilename(path);
@@ -272,19 +272,19 @@ Result VfsDirectoryServiceWrapper::GetEntryType(FileSys::DirectoryEntryType* out
272 return ResultSuccess; 272 return ResultSuccess;
273 } 273 }
274 274
275 return FileSys::ERROR_PATH_NOT_FOUND; 275 return FileSys::ResultPathNotFound;
276} 276}
277 277
278Result VfsDirectoryServiceWrapper::GetFileTimeStampRaw( 278Result VfsDirectoryServiceWrapper::GetFileTimeStampRaw(
279 FileSys::FileTimeStampRaw* out_file_time_stamp_raw, const std::string& path) const { 279 FileSys::FileTimeStampRaw* out_file_time_stamp_raw, const std::string& path) const {
280 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path)); 280 auto dir = GetDirectoryRelativeWrapped(backing, Common::FS::GetParentPath(path));
281 if (dir == nullptr) { 281 if (dir == nullptr) {
282 return FileSys::ERROR_PATH_NOT_FOUND; 282 return FileSys::ResultPathNotFound;
283 } 283 }
284 284
285 FileSys::DirectoryEntryType entry_type; 285 FileSys::DirectoryEntryType entry_type;
286 if (GetEntryType(&entry_type, path) != ResultSuccess) { 286 if (GetEntryType(&entry_type, path) != ResultSuccess) {
287 return FileSys::ERROR_PATH_NOT_FOUND; 287 return FileSys::ResultPathNotFound;
288 } 288 }
289 289
290 *out_file_time_stamp_raw = dir->GetFileTimeStamp(Common::FS::GetFilename(path)); 290 *out_file_time_stamp_raw = dir->GetFileTimeStamp(Common::FS::GetFilename(path));
@@ -317,7 +317,7 @@ Result FileSystemController::OpenProcess(
317 317
318 const auto it = registrations.find(process_id); 318 const auto it = registrations.find(process_id);
319 if (it == registrations.end()) { 319 if (it == registrations.end()) {
320 return FileSys::ERROR_ENTITY_NOT_FOUND; 320 return FileSys::ResultTargetNotFound;
321 } 321 }
322 322
323 *out_program_id = it->second.program_id; 323 *out_program_id = it->second.program_id;
@@ -360,12 +360,12 @@ Result FileSystemController::OpenSDMC(FileSys::VirtualDir* out_sdmc) const {
360 LOG_TRACE(Service_FS, "Opening SDMC"); 360 LOG_TRACE(Service_FS, "Opening SDMC");
361 361
362 if (sdmc_factory == nullptr) { 362 if (sdmc_factory == nullptr) {
363 return FileSys::ERROR_SD_CARD_NOT_FOUND; 363 return FileSys::ResultPortSdCardNoDevice;
364 } 364 }
365 365
366 auto sdmc = sdmc_factory->Open(); 366 auto sdmc = sdmc_factory->Open();
367 if (sdmc == nullptr) { 367 if (sdmc == nullptr) {
368 return FileSys::ERROR_SD_CARD_NOT_FOUND; 368 return FileSys::ResultPortSdCardNoDevice;
369 } 369 }
370 370
371 *out_sdmc = sdmc; 371 *out_sdmc = sdmc;
@@ -377,12 +377,12 @@ Result FileSystemController::OpenBISPartition(FileSys::VirtualDir* out_bis_parti
377 LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", id); 377 LOG_TRACE(Service_FS, "Opening BIS Partition with id={:08X}", id);
378 378
379 if (bis_factory == nullptr) { 379 if (bis_factory == nullptr) {
380 return FileSys::ERROR_ENTITY_NOT_FOUND; 380 return FileSys::ResultTargetNotFound;
381 } 381 }
382 382
383 auto part = bis_factory->OpenPartition(id); 383 auto part = bis_factory->OpenPartition(id);
384 if (part == nullptr) { 384 if (part == nullptr) {
385 return FileSys::ERROR_INVALID_ARGUMENT; 385 return FileSys::ResultInvalidArgument;
386 } 386 }
387 387
388 *out_bis_partition = part; 388 *out_bis_partition = part;
@@ -394,12 +394,12 @@ Result FileSystemController::OpenBISPartitionStorage(
394 LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", id); 394 LOG_TRACE(Service_FS, "Opening BIS Partition Storage with id={:08X}", id);
395 395
396 if (bis_factory == nullptr) { 396 if (bis_factory == nullptr) {
397 return FileSys::ERROR_ENTITY_NOT_FOUND; 397 return FileSys::ResultTargetNotFound;
398 } 398 }
399 399
400 auto part = bis_factory->OpenPartitionStorage(id, system.GetFilesystem()); 400 auto part = bis_factory->OpenPartitionStorage(id, system.GetFilesystem());
401 if (part == nullptr) { 401 if (part == nullptr) {
402 return FileSys::ERROR_INVALID_ARGUMENT; 402 return FileSys::ResultInvalidArgument;
403 } 403 }
404 404
405 *out_bis_partition_storage = part; 405 *out_bis_partition_storage = part;
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp
index 7e0c90a89..9a18f6ec5 100644
--- a/src/core/hle/service/filesystem/fsp/fs_i_file.cpp
+++ b/src/core/hle/service/filesystem/fsp/fs_i_file.cpp
@@ -33,13 +33,13 @@ void IFile::Read(HLERequestContext& ctx) {
33 if (length < 0) { 33 if (length < 0) {
34 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length); 34 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length);
35 IPC::ResponseBuilder rb{ctx, 2}; 35 IPC::ResponseBuilder rb{ctx, 2};
36 rb.Push(FileSys::ERROR_INVALID_SIZE); 36 rb.Push(FileSys::ResultInvalidSize);
37 return; 37 return;
38 } 38 }
39 if (offset < 0) { 39 if (offset < 0) {
40 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset); 40 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset);
41 IPC::ResponseBuilder rb{ctx, 2}; 41 IPC::ResponseBuilder rb{ctx, 2};
42 rb.Push(FileSys::ERROR_INVALID_OFFSET); 42 rb.Push(FileSys::ResultInvalidOffset);
43 return; 43 return;
44 } 44 }
45 45
@@ -66,13 +66,13 @@ void IFile::Write(HLERequestContext& ctx) {
66 if (length < 0) { 66 if (length < 0) {
67 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length); 67 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length);
68 IPC::ResponseBuilder rb{ctx, 2}; 68 IPC::ResponseBuilder rb{ctx, 2};
69 rb.Push(FileSys::ERROR_INVALID_SIZE); 69 rb.Push(FileSys::ResultInvalidSize);
70 return; 70 return;
71 } 71 }
72 if (offset < 0) { 72 if (offset < 0) {
73 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset); 73 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset);
74 IPC::ResponseBuilder rb{ctx, 2}; 74 IPC::ResponseBuilder rb{ctx, 2};
75 rb.Push(FileSys::ERROR_INVALID_OFFSET); 75 rb.Push(FileSys::ResultInvalidOffset);
76 return; 76 return;
77 } 77 }
78 78
diff --git a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp
index 9fe36f31a..98223c1f9 100644
--- a/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp
+++ b/src/core/hle/service/filesystem/fsp/fs_i_storage.cpp
@@ -31,13 +31,13 @@ void IStorage::Read(HLERequestContext& ctx) {
31 if (length < 0) { 31 if (length < 0) {
32 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length); 32 LOG_ERROR(Service_FS, "Length is less than 0, length={}", length);
33 IPC::ResponseBuilder rb{ctx, 2}; 33 IPC::ResponseBuilder rb{ctx, 2};
34 rb.Push(FileSys::ERROR_INVALID_SIZE); 34 rb.Push(FileSys::ResultInvalidSize);
35 return; 35 return;
36 } 36 }
37 if (offset < 0) { 37 if (offset < 0) {
38 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset); 38 LOG_ERROR(Service_FS, "Offset is less than 0, offset={}", offset);
39 IPC::ResponseBuilder rb{ctx, 2}; 39 IPC::ResponseBuilder rb{ctx, 2};
40 rb.Push(FileSys::ERROR_INVALID_OFFSET); 40 rb.Push(FileSys::ResultInvalidOffset);
41 return; 41 return;
42 } 42 }
43 43
diff --git a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
index c35df5530..2be72b021 100644
--- a/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
+++ b/src/core/hle/service/filesystem/fsp/fsp_srv.cpp
@@ -430,7 +430,7 @@ void FSP_SRV::OpenSaveDataFileSystem(HLERequestContext& ctx) {
430 save_data_controller->OpenSaveData(&dir, parameters.space_id, parameters.attribute); 430 save_data_controller->OpenSaveData(&dir, parameters.space_id, parameters.attribute);
431 if (result != ResultSuccess) { 431 if (result != ResultSuccess) {
432 IPC::ResponseBuilder rb{ctx, 2, 0, 0}; 432 IPC::ResponseBuilder rb{ctx, 2, 0, 0};
433 rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); 433 rb.Push(FileSys::ResultTargetNotFound);
434 return; 434 return;
435 } 435 }
436 436
@@ -597,7 +597,7 @@ void FSP_SRV::OpenPatchDataStorageByCurrentProcess(HLERequestContext& ctx) {
597 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, title_id={:016X}", storage_id, title_id); 597 LOG_DEBUG(Service_FS, "called with storage_id={:02X}, title_id={:016X}", storage_id, title_id);
598 598
599 IPC::ResponseBuilder rb{ctx, 2}; 599 IPC::ResponseBuilder rb{ctx, 2};
600 rb.Push(FileSys::ERROR_ENTITY_NOT_FOUND); 600 rb.Push(FileSys::ResultTargetNotFound);
601} 601}
602 602
603void FSP_SRV::OpenDataStorageWithProgramIndex(HLERequestContext& ctx) { 603void FSP_SRV::OpenDataStorageWithProgramIndex(HLERequestContext& ctx) {
diff --git a/src/core/hle/service/filesystem/save_data_controller.cpp b/src/core/hle/service/filesystem/save_data_controller.cpp
index d19b3ea1e..03e45f7f9 100644
--- a/src/core/hle/service/filesystem/save_data_controller.cpp
+++ b/src/core/hle/service/filesystem/save_data_controller.cpp
@@ -44,7 +44,7 @@ Result SaveDataController::CreateSaveData(FileSys::VirtualDir* out_save_data,
44 44
45 auto save_data = factory->Create(space, attribute); 45 auto save_data = factory->Create(space, attribute);
46 if (save_data == nullptr) { 46 if (save_data == nullptr) {
47 return FileSys::ERROR_ENTITY_NOT_FOUND; 47 return FileSys::ResultTargetNotFound;
48 } 48 }
49 49
50 *out_save_data = save_data; 50 *out_save_data = save_data;
@@ -56,7 +56,7 @@ Result SaveDataController::OpenSaveData(FileSys::VirtualDir* out_save_data,
56 const FileSys::SaveDataAttribute& attribute) { 56 const FileSys::SaveDataAttribute& attribute) {
57 auto save_data = factory->Open(space, attribute); 57 auto save_data = factory->Open(space, attribute);
58 if (save_data == nullptr) { 58 if (save_data == nullptr) {
59 return FileSys::ERROR_ENTITY_NOT_FOUND; 59 return FileSys::ResultTargetNotFound;
60 } 60 }
61 61
62 *out_save_data = save_data; 62 *out_save_data = save_data;
@@ -67,7 +67,7 @@ Result SaveDataController::OpenSaveDataSpace(FileSys::VirtualDir* out_save_data_
67 FileSys::SaveDataSpaceId space) { 67 FileSys::SaveDataSpaceId space) {
68 auto save_data_space = factory->GetSaveDataSpaceDirectory(space); 68 auto save_data_space = factory->GetSaveDataSpaceDirectory(space);
69 if (save_data_space == nullptr) { 69 if (save_data_space == nullptr) {
70 return FileSys::ERROR_ENTITY_NOT_FOUND; 70 return FileSys::ResultTargetNotFound;
71 } 71 }
72 72
73 *out_save_data_space = save_data_space; 73 *out_save_data_space = save_data_space;
diff --git a/src/core/hle/service/set/system_settings_server.cpp b/src/core/hle/service/set/system_settings_server.cpp
index f40a1c8f3..b527c39a9 100644
--- a/src/core/hle/service/set/system_settings_server.cpp
+++ b/src/core/hle/service/set/system_settings_server.cpp
@@ -67,13 +67,13 @@ Result GetFirmwareVersionImpl(FirmwareVersionFormat& out_firmware, Core::System&
67 const auto ver_file = romfs->GetFile("file"); 67 const auto ver_file = romfs->GetFile("file");
68 if (ver_file == nullptr) { 68 if (ver_file == nullptr) {
69 return early_exit_failure("The system version archive didn't contain the file 'file'.", 69 return early_exit_failure("The system version archive didn't contain the file 'file'.",
70 FileSys::ERROR_INVALID_ARGUMENT); 70 FileSys::ResultInvalidArgument);
71 } 71 }
72 72
73 auto data = ver_file->ReadAllBytes(); 73 auto data = ver_file->ReadAllBytes();
74 if (data.size() != sizeof(FirmwareVersionFormat)) { 74 if (data.size() != sizeof(FirmwareVersionFormat)) {
75 return early_exit_failure("The system version file 'file' was not the correct size.", 75 return early_exit_failure("The system version file 'file' was not the correct size.",
76 FileSys::ERROR_OUT_OF_BOUNDS); 76 FileSys::ResultOutOfRange);
77 } 77 }
78 78
79 std::memcpy(&out_firmware, data.data(), sizeof(FirmwareVersionFormat)); 79 std::memcpy(&out_firmware, data.data(), sizeof(FirmwareVersionFormat));