From 5cfd3ae4e65e8f12887de7374dd6591449d9454c Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 11 Oct 2020 01:27:20 -0400 Subject: 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 --- firmware/target/hosted/fiio/system-fiio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'firmware/target/hosted/fiio/system-fiio.c') diff --git a/firmware/target/hosted/fiio/system-fiio.c b/firmware/target/hosted/fiio/system-fiio.c index 5e638989a1..f011ceea75 100644 --- a/firmware/target/hosted/fiio/system-fiio.c +++ b/firmware/target/hosted/fiio/system-fiio.c @@ -94,7 +94,7 @@ void power_off(void) { backlight_hw_off(); - axp_hw = open("/dev/axp173", O_RDWR); + axp_hw = open("/dev/axp173", O_RDWR | O_CLOEXEC); if(axp_hw < 0) panicf("Cannot open '/dev/axp173'"); -- cgit