Browse Source

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

Sergey Bugaev 5 years ago
parent
commit
88f5991c29
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Servers/WindowServer/WSScreen.cpp

+ 5 - 1
Servers/WindowServer/WSScreen.cpp

@@ -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;