Blame SOURCES/0006-fix-714-system-width-detection.patch

21ef37
From cb3c2999b586aaef7e5bd5ba60f1e3631ec756c1 Mon Sep 17 00:00:00 2001
21ef37
From: Lyonel Vincent <lyonel@ezix.org>
21ef37
Date: Fri, 6 May 2016 16:38:38 +0200
21ef37
Subject: [PATCH 06/43] fix #714 (system width detection)
21ef37
21ef37
---
21ef37
 src/core/abi.cc | 4 +++-
21ef37
 1 file changed, 3 insertions(+), 1 deletion(-)
21ef37
21ef37
diff --git a/src/core/abi.cc b/src/core/abi.cc
21ef37
index 76e5082..adff7b5 100644
21ef37
--- a/src/core/abi.cc
21ef37
+++ b/src/core/abi.cc
21ef37
@@ -20,7 +20,9 @@ __ID("@(#) $Id: mem.cc 1352 2006-05-27 23:54:13Z ezix $");
21ef37
 bool scan_abi(hwNode & system)
21ef37
 {
21ef37
   // are we compiled as 32- or 64-bit process ?
21ef37
-  system.setWidth(sysconf(LONG_BIT));
21ef37
+  long sc = sysconf(LONG_BIT);
21ef37
+  if(sc==-1) sc = sysconf(_SC_LONG_BIT);
21ef37
+  if(sc!=-1) system.setWidth(sc);
21ef37
 
21ef37
   pushd(PROC_SYS);
21ef37
 
21ef37
-- 
21ef37
2.10.2
21ef37