aboutsummaryrefslogtreecommitdiff
path: root/src/common/host_memory.cpp
diff options
context:
space:
mode:
authorlizzie <lizzie@eden-emu.dev>2025-08-15 04:12:45 +0200
committercrueter <crueter@eden-emu.dev>2025-08-15 04:12:45 +0200
commite807e32b1aee1daff61b8ebf61f7b38bd895a8c9 (patch)
tree3e01449fd9ef0b39f87cf304d13d6690a4337bc8 /src/common/host_memory.cpp
parentc39e3bece60fb0af6fa1652bee87c2cb8f75dd80 (diff)
[compat] fix solaris Qt build (#194)
Co-authored-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/194 Reviewed-by: crueter <crueter@eden-emu.dev> Co-authored-by: lizzie <lizzie@eden-emu.dev> Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/common/host_memory.cpp')
-rw-r--r--src/common/host_memory.cpp35
1 files changed, 16 insertions, 19 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp
index 9e34cd3ac6..949cd188f3 100644
--- a/src/common/host_memory.cpp
+++ b/src/common/host_memory.cpp
@@ -442,16 +442,15 @@ static int shm_open_anon(int flags, mode_t mode) {
for (char *fill = start; fill < limit; r /= 8)
*fill++ = '0' + (r % 8);
int fd = shm_open(name, flags, mode);
- if (fd != -1)
- return ([](const char *name, int fd) {
- if (shm_unlink(name) == -1) {
- int tmp = errno;
- close(fd);
- errno = tmp;
- return -1;
- }
- return fd;
- })(name, fd);
+ if (fd != -1) {
+ if (shm_unlink(name) == -1) {
+ int tmp = errno;
+ close(fd);
+ errno = tmp;
+ return -1;
+ }
+ return fd;
+ }
if (errno != EEXIST)
break;
}
@@ -464,15 +463,13 @@ static int shm_open_anon(int flags, mode_t mode) {
int fd;
if ((fd = shm_mkstemp(name)) == -1)
return -1;
- return ([](const char *name, int fd) {
- if (shm_unlink(name) == -1) {
- int tmp = errno;
- close(fd);
- errno = tmp;
- return -1;
- }
- return fd;
- })(name, fd);
+ if (shm_unlink(name) == -1) {
+ int tmp = errno;
+ close(fd);
+ errno = tmp;
+ return -1;
+ }
+ return fd;
}
#endif