mirror of
https://github.com/yuzu-mirror/yuzu
synced 2024-11-28 02:50:19 +00:00
HLE/FS: Corrected the error codes for CreateFile
This commit is contained in:
parent
381a5c053f
commit
b350f192bb
2 changed files with 7 additions and 2 deletions
|
@ -40,8 +40,11 @@ bool DiskArchive::DeleteDirectory(const Path& path) const {
|
||||||
ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const {
|
ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const {
|
||||||
std::string full_path = mount_point + path.AsString();
|
std::string full_path = mount_point + path.AsString();
|
||||||
|
|
||||||
|
if (FileUtil::IsDirectory(full_path))
|
||||||
|
return ResultCode(ErrorDescription::FS_NotAFile, ErrorModule::FS, ErrorSummary::Canceled, ErrorLevel::Status);
|
||||||
|
|
||||||
if (FileUtil::Exists(full_path))
|
if (FileUtil::Exists(full_path))
|
||||||
return ResultCode(ErrorDescription::AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Info);
|
return ResultCode(ErrorDescription::FS_AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Status);
|
||||||
|
|
||||||
if (size == 0) {
|
if (size == 0) {
|
||||||
FileUtil::CreateEmptyFile(full_path);
|
FileUtil::CreateEmptyFile(full_path);
|
||||||
|
|
|
@ -19,7 +19,9 @@
|
||||||
enum class ErrorDescription : u32 {
|
enum class ErrorDescription : u32 {
|
||||||
Success = 0,
|
Success = 0,
|
||||||
WrongAddress = 53,
|
WrongAddress = 53,
|
||||||
FS_NotFound = 100,
|
FS_NotFound = 120,
|
||||||
|
FS_AlreadyExists = 190,
|
||||||
|
FS_NotAFile = 250,
|
||||||
FS_NotFormatted = 340, ///< This is used by the FS service when creating a SaveData archive
|
FS_NotFormatted = 340, ///< This is used by the FS service when creating a SaveData archive
|
||||||
InvalidSection = 1000,
|
InvalidSection = 1000,
|
||||||
TooLarge = 1001,
|
TooLarge = 1001,
|
||||||
|
|
Loading…
Reference in a new issue