(features_cpu.c) Use filestream

This commit is contained in:
twinaphex 2016-06-03 00:17:09 +02:00
parent ac6a319a9d
commit 9c8f29c1ec

View File

@ -289,14 +289,14 @@ static void arm_enable_runfast_mode(void)
#if defined(__linux__) && !defined(CPU_X86)
static unsigned char check_arm_cpu_feature(const char* feature)
{
unsigned char status = 0;
FILE *fp = fopen("/proc/cpuinfo", "r");
if (fp)
{
char line[1024];
unsigned char status = 0;
RFILE *fp = filestream_open("/proc/cpuinfo", RFILE_MODE_READ, -1);
while (fgets(line , sizeof(line) , fp) != NULL)
if (!fp)
return 0;
while (filestream_gets(fp, line, sizeof(line)) != NULL)
{
if (strncmp(line, "Features\t: ", 11))
continue;
@ -307,8 +307,8 @@ static unsigned char check_arm_cpu_feature(const char* feature)
break;
}
fclose(fp);
}
filestream_close(fp);
return status;
}