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/sonynwz/system-nwz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'firmware/target/hosted/sonynwz') diff --git a/firmware/target/hosted/sonynwz/system-nwz.c b/firmware/target/hosted/sonynwz/system-nwz.c index b20ee71774..c10c26250b 100644 --- a/firmware/target/hosted/sonynwz/system-nwz.c +++ b/firmware/target/hosted/sonynwz/system-nwz.c @@ -49,7 +49,7 @@ static void compute_kern_mod_list(void) kern_mod_list = malloc(sizeof(const char **)); kern_mod_list[0] = NULL; /* read from proc file system */ - FILE *f = fopen("/proc/modules", "r"); + FILE *f = fopen("/proc/modules", "re"); if(f == NULL) { printf("Cannot open /proc/modules"); @@ -94,7 +94,7 @@ static void dump_proc_map(void) { const char *file = "/proc/self/maps"; printf("Dumping %s...\n", file); - FILE *f = fopen(file, "r"); + FILE *f = fopen(file, "re"); if(f == NULL) { perror("Cannot open file"); -- cgit v1.2.3