fbaccel: open all devices with O_CLOEXEC

This commit is contained in:
Stefan Seyfried
2015-02-01 20:08:19 +01:00
parent 40eb531728
commit 2079a2fcf8

View File

@@ -221,7 +221,7 @@ CFbAccel::CFbAccel(CFrameBuffer *_fb)
lbb_off = 0; lbb_off = 0;
} }
lbb = fb->lfb + lbb_sz; lbb = fb->lfb + lbb_sz;
bpafd = open("/dev/bpamem0", O_RDWR); bpafd = open("/dev/bpamem0", O_RDWR | O_CLOEXEC);
if (bpafd < 0) if (bpafd < 0)
{ {
fprintf(stderr, "[neutrino] FB: cannot open /dev/bpamem0: %m\n"); fprintf(stderr, "[neutrino] FB: cannot open /dev/bpamem0: %m\n");
@@ -245,7 +245,7 @@ CFbAccel::CFbAccel(CFrameBuffer *_fb)
char bpa_mem_device[30]; char bpa_mem_device[30];
sprintf(bpa_mem_device, "/dev/bpamem%d", bpa_data.device_num); sprintf(bpa_mem_device, "/dev/bpamem%d", bpa_data.device_num);
bpafd = open(bpa_mem_device, O_RDWR); bpafd = open(bpa_mem_device, O_RDWR | O_CLOEXEC);
if (bpafd < 0) if (bpafd < 0)
{ {
fprintf(stderr, "[neutrino] FB: cannot open secondary %s: %m\n", bpa_mem_device); fprintf(stderr, "[neutrino] FB: cannot open secondary %s: %m\n", bpa_mem_device);
@@ -265,7 +265,7 @@ CFbAccel::CFbAccel(CFrameBuffer *_fb)
#ifdef USE_NEVIS_GXA #ifdef USE_NEVIS_GXA
/* Open /dev/mem for HW-register access */ /* Open /dev/mem for HW-register access */
devmem_fd = open("/dev/mem", O_RDWR | O_SYNC); devmem_fd = open("/dev/mem", O_RDWR | O_SYNC | O_CLOEXEC);
if (devmem_fd < 0) { if (devmem_fd < 0) {
perror("CFbAccel open /dev/mem"); perror("CFbAccel open /dev/mem");
goto error; goto error;