mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-11 03:00:16 +01:00
[rpcsx-os] shm: convert error code
This commit is contained in:
parent
9f30ad9d72
commit
d814b2b741
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue