From b350f192bbfe61a212e00ea70d4dcd7d3e90b60a Mon Sep 17 00:00:00 2001
From: Subv <subv2112@gmail.com>
Date: Mon, 28 Dec 2015 09:55:38 -0500
Subject: [PATCH] HLE/FS: Corrected the error codes for CreateFile

---
 src/core/file_sys/disk_archive.cpp | 5 ++++-
 src/core/hle/result.h              | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/core/file_sys/disk_archive.cpp b/src/core/file_sys/disk_archive.cpp
index 614c2e2a0a..5c68e944f7 100644
--- a/src/core/file_sys/disk_archive.cpp
+++ b/src/core/file_sys/disk_archive.cpp
@@ -40,8 +40,11 @@ bool DiskArchive::DeleteDirectory(const Path& path) const {
 ResultCode DiskArchive::CreateFile(const FileSys::Path& path, u64 size) const {
     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))
-        return ResultCode(ErrorDescription::AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Info);
+        return ResultCode(ErrorDescription::FS_AlreadyExists, ErrorModule::FS, ErrorSummary::NothingHappened, ErrorLevel::Status);
 
     if (size == 0) {
         FileUtil::CreateEmptyFile(full_path);
diff --git a/src/core/hle/result.h b/src/core/hle/result.h
index 69613fbbbe..b9ee5f7d99 100644
--- a/src/core/hle/result.h
+++ b/src/core/hle/result.h
@@ -19,7 +19,9 @@
 enum class ErrorDescription : u32 {
     Success = 0,
     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
     InvalidSection = 1000,
     TooLarge = 1001,