util/cacheinfo: fix crash when compiling with uClibc
commit00b5032eaddb7193f03f0a28b10286244d2e2a7b
authorCarlos Santos <casantos@redhat.com>
Thu, 17 Oct 2019 12:37:13 +0000 (17 09:37 -0300)
committerRichard Henderson <richard.henderson@linaro.org>
Wed, 22 Jan 2020 00:18:12 +0000 (21 14:18 -1000)
treedb60aa670ca04cdc384eef613d6a3d9d5ad1a416
parent7b7d00e0a714e0bdcd4c8a76f0927e1c8f1b2121
util/cacheinfo: fix crash when compiling with uClibc

uClibc defines _SC_LEVEL1_ICACHE_LINESIZE and _SC_LEVEL1_DCACHE_LINESIZE
but the corresponding sysconf calls returns -1, which is a valid result,
meaning that the limit is indeterminate.

Handle this situation using the fallback values instead of crashing due
to an assertion failure.

Signed-off-by: Carlos Santos <casantos@redhat.com>
Message-Id: <20191017123713.30192-1-casantos@redhat.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
util/cacheinfo.c