forked from len0rd/rockbox
Fix intermittent warning on sdl app build.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31553 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
d6db4cc105
commit
eb488ac792
1 changed files with 6 additions and 6 deletions
|
@ -141,12 +141,12 @@ int cpufrequency_linux(int cpu)
|
||||||
{
|
{
|
||||||
char path[64];
|
char path[64];
|
||||||
char temp[10];
|
char temp[10];
|
||||||
int cpu_dev, ret;
|
int cpu_dev, ret = -1;
|
||||||
snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_cur_freq", cpu);
|
snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq/cpuinfo_cur_freq", cpu);
|
||||||
cpu_dev = open(path, O_RDONLY);
|
cpu_dev = open(path, O_RDONLY);
|
||||||
if (cpu_dev < 0)
|
if (cpu_dev < 0)
|
||||||
return -1;
|
return -1;
|
||||||
read(cpu_dev, temp, 10);
|
if (read(cpu_dev, temp, sizeof(tmp)) >= 0)
|
||||||
ret = atoi(temp);
|
ret = atoi(temp);
|
||||||
close(cpu_dev);
|
close(cpu_dev);
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -156,12 +156,12 @@ int scalingfrequency_linux(int cpu)
|
||||||
{
|
{
|
||||||
char path[64];
|
char path[64];
|
||||||
char temp[10];
|
char temp[10];
|
||||||
int cpu_dev, ret;
|
int cpu_dev, ret = -1;
|
||||||
snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", cpu);
|
snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/cpufreq/scaling_cur_freq", cpu);
|
||||||
cpu_dev = open(path, O_RDONLY);
|
cpu_dev = open(path, O_RDONLY);
|
||||||
if (cpu_dev < 0)
|
if (cpu_dev < 0)
|
||||||
return -1;
|
return -1;
|
||||||
read(cpu_dev, temp, 10);
|
if (read(cpu_dev, temp, sizeof(tmp)) >= 0)
|
||||||
ret = atoi(temp);
|
ret = atoi(temp);
|
||||||
close(cpu_dev);
|
close(cpu_dev);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue