summaryrefslogtreecommitdiff
path: root/firmware/target/hosted/sonynwz
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/sonynwz
parent4f8736909a92b0fcf6be25793791625c243061d1 (diff)
downloadrockbox-5cfd3ae4e65e8f12887de7374dd6591449d9454c.tar.gz
rockbox-5cfd3ae4e65e8f12887de7374dd6591449d9454c.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/sonynwz')
-rw-r--r--firmware/target/hosted/sonynwz/system-nwz.c4
1 files changed, 2 insertions, 2 deletions
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)
49 kern_mod_list = malloc(sizeof(const char **)); 49 kern_mod_list = malloc(sizeof(const char **));
50 kern_mod_list[0] = NULL; 50 kern_mod_list[0] = NULL;
51 /* read from proc file system */ 51 /* read from proc file system */
52 FILE *f = fopen("/proc/modules", "r"); 52 FILE *f = fopen("/proc/modules", "re");
53 if(f == NULL) 53 if(f == NULL)
54 { 54 {
55 printf("Cannot open /proc/modules"); 55 printf("Cannot open /proc/modules");
@@ -94,7 +94,7 @@ static void dump_proc_map(void)
94{ 94{
95 const char *file = "/proc/self/maps"; 95 const char *file = "/proc/self/maps";
96 printf("Dumping %s...\n", file); 96 printf("Dumping %s...\n", file);
97 FILE *f = fopen(file, "r"); 97 FILE *f = fopen(file, "re");
98 if(f == NULL) 98 if(f == NULL)
99 { 99 {
100 perror("Cannot open file"); 100 perror("Cannot open file");