summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGfx/Bitmap.cpp
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2022-07-10 15:30:08 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-19 12:39:24 +0200
commit42e22f89a49ff766ae73c0a486b55b1bf4ff44d7 (patch)
tree4b03e0a81d629afbd7e01086f822fef136629bc6 /Userland/Libraries/LibGfx/Bitmap.cpp
parent4bed2ef66b6fc1b7419eeb951d3b479a39fe5076 (diff)
downloadserenity-42e22f89a49ff766ae73c0a486b55b1bf4ff44d7.zip
AK+LibGfx+LibJS: Pass -1 as the file descriptor to anonymous mmap
Serenity/Linux/macOS ignore the file descriptor when an anonymous mapping is requested. However, BSDs require the fd to be -1.
Diffstat (limited to 'Userland/Libraries/LibGfx/Bitmap.cpp')
-rw-r--r--Userland/Libraries/LibGfx/Bitmap.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/Bitmap.cpp b/Userland/Libraries/LibGfx/Bitmap.cpp
index a6ca112f93..e4b8178099 100644
--- a/Userland/Libraries/LibGfx/Bitmap.cpp
+++ b/Userland/Libraries/LibGfx/Bitmap.cpp
@@ -558,7 +558,7 @@ ErrorOr<BackingStore> Bitmap::allocate_backing_store(BitmapFormat format, IntSiz
map_flags |= MAP_PURGEABLE;
void* data = mmap_with_name(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0, String::formatted("GraphicsBitmap [{}]", size).characters());
#else
- void* data = mmap(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, 0, 0);
+ void* data = mmap(nullptr, data_size_in_bytes, PROT_READ | PROT_WRITE, map_flags, -1, 0);
#endif
if (data == MAP_FAILED)
return Error::from_errno(errno);