diff options
author | Tom Rondeau <trondeau@vt.edu> | 2013-07-16 13:23:54 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2013-07-16 13:23:54 -0400 |
commit | cc0ec5b22470af201f8ad949266c8f66597050ed (patch) | |
tree | 5616822ade150df2e977bdd61e64591c0ad1c268 | |
parent | 45e7e6a61d2e99c32e3d2760431292b365c7809c (diff) |
volk: fix some ARM test functions that resulted in an infinite loop on some processors.
-rw-r--r-- | volk/tmpl/volk_cpu.tmpl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/volk/tmpl/volk_cpu.tmpl.c b/volk/tmpl/volk_cpu.tmpl.c index 81fc679cbc..b1a0a4afe1 100644 --- a/volk/tmpl/volk_cpu.tmpl.c +++ b/volk/tmpl/volk_cpu.tmpl.c @@ -116,10 +116,11 @@ static int has_neon(void){ auxvec_f = fopen("/proc/self/auxv", "rb"); if(!auxvec_f) return 0; + size_t r = 1; //so auxv is basically 32b of ID and 32b of value //so it goes like this - while(!found_neon && auxvec_f) { - fread(auxvec, sizeof(unsigned long), 2, auxvec_f); + while(!found_neon && r) { + r = fread(auxvec, sizeof(unsigned long), 2, auxvec_f); if((auxvec[0] == AT_HWCAP) && (auxvec[1] & HWCAP_NEON)) found_neon = 1; } |