summaryrefslogtreecommitdiff
path: root/src/protocols/core/Shm.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/core/Shm.cpp')
-rw-r--r--src/protocols/core/Shm.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/protocols/core/Shm.cpp b/src/protocols/core/Shm.cpp
index ce7d3a61..4088949f 100644
--- a/src/protocols/core/Shm.cpp
+++ b/src/protocols/core/Shm.cpp
@@ -97,7 +97,7 @@ void CSHMPool::resize(size_t size_) {
size = size_;
data = mmap(nullptr, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (!data)
+ if (data == MAP_FAILED)
LOGM(ERR, "Couldn't mmap {} bytes from fd {} of shm client", size, fd);
}
@@ -146,7 +146,7 @@ CWLSHMPoolResource::CWLSHMPoolResource(SP<CWlShmPool> resource_, int fd_, size_t
RESOURCE->resource->buffer = RESOURCE;
});
- if (!pool->data)
+ if (pool->data == MAP_FAILED)
resource->error(WL_SHM_ERROR_INVALID_FD, "Couldn't mmap from fd");
}