void-packages/srcpkgs/lshw/patches/musl-long_bits.patch

21 lines
642 B
Diff

sysconf(LONG_BIT) isn't correct usage of sysconf(3).
musl doesn't define _SC_LONG_BIT, so just use LONG_BIT directly. There's really
no reason to use sysconf(3) here, word size isn't a runtime property.
diff --git src/core/abi.cc src/core/abi.cc
index adff7b5..76c664c 100644
--- src/core/abi.cc
+++ src/core/abi.cc
@@ -20,9 +20,7 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
bool scan_abi(hwNode & system)
{
// are we compiled as 32- or 64-bit process ?
- long sc = sysconf(LONG_BIT);
- if(sc==-1) sc = sysconf(_SC_LONG_BIT);
- if(sc!=-1) system.setWidth(sc);
+ system.setWidth(LONG_BIT);
pushd(PROC_SYS);