1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:07:35 +00:00

WindowServer: Print the error when failing to open /dev/fb0

This commit is contained in:
Sergey Bugaev 2020-01-19 01:01:46 +03:00 committed by Andreas Kling
parent 862b3ccb4e
commit 88f5991c29

View file

@ -31,6 +31,7 @@
#include "WSWindowManager.h"
#include <Kernel/FB.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/mman.h>
#include <unistd.h>
@ -47,7 +48,10 @@ WSScreen::WSScreen(unsigned desired_width, unsigned desired_height)
ASSERT(!s_the);
s_the = this;
m_framebuffer_fd = open("/dev/fb0", O_RDWR | O_CLOEXEC);
ASSERT(m_framebuffer_fd >= 0);
if (m_framebuffer_fd < 0) {
perror("failed to open /dev/fb0");
ASSERT_NOT_REACHED();
}
if (fb_set_buffer(m_framebuffer_fd, 0) == 0) {
m_can_set_buffer = true;