fb_generic: open device O_CLOEXEC, better diagnostic output

Origin commit data
------------------
Commit: 8441a719cb
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-08 (Wed, 08 Feb 2017)
This commit is contained in:
Stefan Seyfried
2017-02-08 23:38:00 +01:00
committed by Michael Liebmann
parent 937b418f74
commit 79931d6c88

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;