1
0
Fork 0
forked from len0rd/rockbox

hosted: Use O_CLOEXEC for all open() and "e" for fopen() calls

This way we'll automatically close the files upon exec()

Change-Id: Ic0daca8fb56432830de4a2f4a86a77337121ecc7
This commit is contained in:
Solomon Peachy 2020-10-11 01:27:20 -04:00
parent 4f8736909a
commit 5cfd3ae4e6
14 changed files with 27 additions and 31 deletions

View file

@ -47,17 +47,12 @@ static void redraw(void)
void lcd_init_device(void)
{
const char * const fb_dev = "/dev/fb0";
fd = open(fb_dev, O_RDWR /* | O_SYNC */);
fd = open(fb_dev, O_RDWR | O_CLOEXEC);
if(fd < 0)
{
panicf("Cannot open framebuffer: %s\n", fb_dev);
}
if (fcntl( fd, F_SETFD, FD_CLOEXEC ) < 0)
{
panicf("Can't set CLOEXEC");
}
/* get fixed and variable information */
if(ioctl(fd, FBIOGET_FSCREENINFO, &finfo) < 0)
{