From 05d6a0b1ab5097c8a2fb4c3135eed9b86ce85557 Mon Sep 17 00:00:00 2001 From: patchzyy <64382339+patchzyy@users.noreply.github.com> Date: Mon, 7 Sep 2026 23:03:41 +0200 Subject: [PATCH] Report NAND move destination conflicts correctly --- runtime/src/hle/storage/nand_api.cpp | 4 ++++ runtime/src/hle/storage/nand_file_ops.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/runtime/src/hle/storage/nand_api.cpp b/runtime/src/hle/storage/nand_api.cpp index ca8eee7..38c6e4e 100644 --- a/runtime/src/hle/storage/nand_api.cpp +++ b/runtime/src/hle/storage/nand_api.cpp @@ -384,6 +384,10 @@ extern "C" int32_t NANDMove_HLE(uint32_t srcPathPtr, uint32_t dstPathPtr) { return NAND_RESULT_OK; } + if (ec == std::errc::file_exists) { + return NAND_RESULT_EXISTS; + } + LogNandError("NANDMove", "FAILED error=%d message='%s'", ec.value(), ec.message().c_str()); return NAND_RESULT_UNKNOWN; } diff --git a/runtime/src/hle/storage/nand_file_ops.h b/runtime/src/hle/storage/nand_file_ops.h index 7f149b7..ac77a14 100644 --- a/runtime/src/hle/storage/nand_file_ops.h +++ b/runtime/src/hle/storage/nand_file_ops.h @@ -6,5 +6,7 @@ // Move without replacing an existing entry. Cross-filesystem regular files are // staged at the destination before removing the source. On failure the source // remains; a failed source removal can leave both complete copies. +// The caller must keep the source stable for the duration of the move; NAND HLE +// calls run synchronously on the cooperative guest thread without yielding. void NandMove(const std::filesystem::path& source, const std::filesystem::path& destination, std::error_code& ec);