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:
parent
4f8736909a
commit
5cfd3ae4e6
14 changed files with 27 additions and 31 deletions
|
@ -176,7 +176,7 @@ bool current_scaling_governor(int cpu, char* governor, int governor_size)
|
|||
sizeof(path),
|
||||
"/sys/devices/system/cpu/cpu%d/cpufreq/scaling_governor",
|
||||
cpu);
|
||||
FILE *f = fopen(path, "r");
|
||||
FILE *f = fopen(path, "re");
|
||||
if(f == NULL)
|
||||
{
|
||||
DEBUGF("ERROR %s: Can not open %s for reading.", __func__, path);
|
||||
|
@ -252,7 +252,7 @@ static int read_cpu_frequency(int cpu, enum cpu_frequency_options freqOpt)
|
|||
}
|
||||
}
|
||||
|
||||
FILE *f = fopen(path, "r");
|
||||
FILE *f = fopen(path, "re");
|
||||
if(f == NULL)
|
||||
{
|
||||
DEBUGF("ERROR %s: Can not open %s for reading.", __func__, path);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue