summaryrefslogtreecommitdiffstats
path: root/firmware/target/hosted/lcd-linuxfb.c
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-11 01:27:20 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-11 01:47:03 -0400
commit5cfd3ae4e65e8f12887de7374dd6591449d9454c (patch)
treed547270bdd3b843dea917d4b2579c50303a4d3a4 /firmware/target/hosted/lcd-linuxfb.c
parent4f8736909a92b0fcf6be25793791625c243061d1 (diff)
downloadrockbox-5cfd3ae4e6.tar.gz
rockbox-5cfd3ae4e6.tar.bz2
rockbox-5cfd3ae4e6.zip
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
Diffstat (limited to 'firmware/target/hosted/lcd-linuxfb.c')
-rw-r--r--firmware/target/hosted/lcd-linuxfb.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/firmware/target/hosted/lcd-linuxfb.c b/firmware/target/hosted/lcd-linuxfb.c
index e85b920fef..14c8c30f89 100644
--- a/firmware/target/hosted/lcd-linuxfb.c
+++ b/firmware/target/hosted/lcd-linuxfb.c
@@ -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)
{