summaryrefslogtreecommitdiff
path: root/Servers/WindowServer
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-11-13 16:00:59 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-11-13 16:37:04 +0100
commitbf012ca10a9da916c5db9a6c9500622f055692df (patch)
treeff48e57cba4bcaa7abc9570dcff099ff778b5123 /Servers/WindowServer
parentcfdbb712fbf4dbb8587d986eab77d77093da5fbf (diff)
downloadserenity-bf012ca10a9da916c5db9a6c9500622f055692df.zip
WindowServer: Fix leaking framebuffer fd to clients
Now that the WindowServer's menu is the primary way to start apps, it is especially noticable that it leaks the /dev/fb0 fd to the apps that it spawns. Fix that by opening it with O_CLOEXEC.
Diffstat (limited to 'Servers/WindowServer')
-rw-r--r--Servers/WindowServer/WSScreen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSScreen.cpp b/Servers/WindowServer/WSScreen.cpp
index 7e76e217f0..c3e2f9f8d4 100644
--- a/Servers/WindowServer/WSScreen.cpp
+++ b/Servers/WindowServer/WSScreen.cpp
@@ -20,7 +20,7 @@ WSScreen::WSScreen(unsigned desired_width, unsigned desired_height)
{
ASSERT(!s_the);
s_the = this;
- m_framebuffer_fd = open("/dev/fb0", O_RDWR);
+ m_framebuffer_fd = open("/dev/fb0", O_RDWR | O_CLOEXEC);
ASSERT(m_framebuffer_fd >= 0);
if (fb_set_buffer(m_framebuffer_fd, 0) == 0) {