Skip to content

Commit

Permalink
Return error code if MkDir fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpd002 committed Oct 23, 2023
1 parent e6320c4 commit 6003b61
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Source/ee/Ee_LibMc2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ using namespace Ee;
//Really not sure about these
#define MC2_RESULT_OK 0
#define MC2_RESULT_ERROR_NOT_FOUND 0x81010002
#define MC2_RESULT_ERROR_ALREADY_EXISTS 0x81010011

CLibMc2::CLibMc2(uint8* ram, CPS2OS& eeBios, CIopBios& iopBios)
: m_ram(ram)
Expand Down Expand Up @@ -646,9 +647,16 @@ int32 CLibMc2::MkDirAsync(uint32 socketId, uint32 pathPtr)

mcServ->Invoke(MCSERV_CMD(CMD_ID_OPEN), reinterpret_cast<uint32*>(&cmd), sizeof(cmd), reinterpret_cast<uint32*>(&result), sizeof(uint32), nullptr);

assert(result >= 0);
if(result < 0)
{
assert(result == Iop::CMcServ::RET_NO_ENTRY);
m_lastResult = MC2_RESULT_ERROR_ALREADY_EXISTS;
}
else
{
m_lastResult = MC2_RESULT_OK;
}

m_lastResult = MC2_RESULT_OK;
m_lastCmd = SYSCALL_MC2_MKDIR_ASYNC & 0xFF;

return 0;
Expand Down

0 comments on commit 6003b61

Please sign in to comment.