eventflag fix create flag handling

This commit is contained in:
Martin Baliet 2024-04-08 12:34:17 +02:00
parent bf4100dfdc
commit 27e2c04ec2
2 changed files with 4 additions and 21 deletions

View File

@ -147,7 +147,7 @@ int KernelEventFlag::wait(uint64_t bits, WaitMode wait_mode, ClearMode clear_mod
if (m_status == Status::Canceled) {
return getErr(ErrCode::_ECANCELED);
} else if (m_status == Status::Deleted) {
return getErr(ErrCode::_EACCES);
return getErr(ErrCode::_EINTR);
}
// -
@ -169,6 +169,7 @@ int deleteEventFlag(IKernelEventFlag_t ef) {
if (ef == nullptr) {
return getErr(ErrCode::_ESRCH);
}
LOG_INFO(L"Deleted ptr:0x%08llx", (uint64_t)ef);
delete ef;
return Ok;

View File

@ -16,26 +16,8 @@ EXPORT SYSV_ABI int sceKernelCreateEventFlag(IKernelEventFlag_t* ef, const char*
return getErr(ErrCode::_EINVAL);
}
bool single = true;
bool fifo = true;
switch (attr) {
case 0x10:
case 0x11:
single = true;
fifo = true;
break;
case 0x20:
case 0x21:
single = false;
fifo = true;
break;
case 0x22:
single = false;
fifo = false;
break;
default: LOG_CRIT(L"unknown attr: %u", attr);
}
bool const single = (attr & 0x30) == 0x10;
bool fifo = (attr & 0x03) == 0x1;
std::string _name;
if (name != nullptr) _name = std::string(name);