fb_generic: open device O_CLOEXEC, better diagnostic output

This commit is contained in:
Stefan Seyfried
2017-02-08 23:38:00 +01:00
committed by M. Liebmann
parent 1500716fcf
commit 8441a719cb

View File

@@ -145,7 +145,7 @@ void CFrameBuffer::init(const char * const fbDevice)
{
int tr = 0xFF;
fd = open(fbDevice, O_RDWR);
fd = open(fbDevice, O_RDWR|O_CLOEXEC);
if (fd<0) {
perror(fbDevice);
@@ -165,9 +165,8 @@ void CFrameBuffer::init(const char * const fbDevice)
}
available=fix.smem_len;
printf("[fb_generic] %dk video mem\n", available/1024);
printf("[fb_generic] [%s] framebuffer %dk video mem\n", fix.id, available/1024);
lbb = lfb = (fb_pixel_t*)mmap(0, available, PROT_WRITE|PROT_READ, MAP_SHARED, fd, 0);
if (!lfb) {
perror("mmap");
goto nolfb;