1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-24 23:37:43 +00:00

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.
This commit is contained in:
Sergey Bugaev 2019-11-13 16:00:59 +03:00 committed by Andreas Kling
parent cfdbb712fb
commit bf012ca10a

View file

@ -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) {