1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-29 07:53:37 +02:00

Fix failing tests on Linux & Android

This commit is contained in:
Arvid Gerstmann 2018-05-04 09:30:32 +02:00
parent 8d726f81f0
commit 235d57c591

View File

@ -110,13 +110,13 @@ static uint32_t GetElfHwcapFromProcSelfAuxv(uint32_t hwcap_type) {
} entry; } entry;
uint32_t result = 0; uint32_t result = 0;
const char filepath[] = "/proc/self/auxv"; const char filepath[] = "/proc/self/auxv";
const int fd = OpenFile(filepath); const int fd = CpuFeatures_OpenFile(filepath);
if (fd < 0) { if (fd < 0) {
D("Could not open %s\n", filepath); D("Could not open %s\n", filepath);
return 0; return 0;
} }
for (;;) { for (;;) {
const int ret = ReadFile(fd, (char*)&entry, sizeof entry); const int ret = CpuFeatures_ReadFile(fd, (char*)&entry, sizeof entry);
if (ret < 0) { if (ret < 0) {
D("Error while reading %s\n", filepath); D("Error while reading %s\n", filepath);
break; break;
@ -130,7 +130,7 @@ static uint32_t GetElfHwcapFromProcSelfAuxv(uint32_t hwcap_type) {
break; break;
} }
} }
CloseFile(fd); CpuFeatures_CloseFile(fd);
return result; return result;
} }