[rpcsx-os] shm: convert error code

This commit is contained in:
DH 2023-11-11 20:31:12 +03:00
parent 9f30ad9d72
commit d814b2b741
3 changed files with 3 additions and 3 deletions

View file

@ -214,7 +214,7 @@ static orbis::ErrorCode convertErrorCode(const std::error_code &code) {
return convertErrc(static_cast<std::errc>(code.value()));
}
static orbis::ErrorCode convertErrno() {
orbis::ErrorCode convertErrno() {
switch (auto error = errno) {
case EPERM:
return orbis::ErrorCode::PERM;

View file

@ -48,6 +48,7 @@ struct IoDevice : orbis::RcBase {
}
};
orbis::ErrorCode convertErrno();
IoDevice *createHostIoDevice(orbis::kstring hostPath);
orbis::ErrorCode createSocket(orbis::Ref<orbis::File> *file,
orbis::kstring name, int dom, int type, int prot);

View file

@ -38,8 +38,7 @@ orbis::ErrorCode ShmDevice::open(orbis::Ref<orbis::File> *file,
int fd = shm_open(name.c_str(), realFlags, S_IRUSR | S_IWUSR);
if (fd < 0) {
std::printf("shm_open: error %u\n", errno);
return orbis::ErrorCode::ACCES;
return convertErrno();
}
auto hostFile = createHostFile(fd, this);
if (size != 0) {