From: Thomas Weißschuh Date: Sun, 30 Oct 2022 15:06:37 +0000 (+0100) Subject: lscpu: use runtime byteorder X-Git-Tag: v2.39-rc1~367^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e3858fc47231e688d65247a1a226c71745796bf;p=thirdparty%2Futil-linux.git lscpu: use runtime byteorder --- diff --git a/sys-utils/lscpu.c b/sys-utils/lscpu.c index 85ef5abcbb..080c9f6e9c 100644 --- a/sys-utils/lscpu.c +++ b/sys-utils/lscpu.c @@ -40,6 +40,7 @@ #include "closestream.h" #include "optutils.h" #include "c_strtod.h" +#include "sysfs.h" #include "lscpu.h" @@ -998,11 +999,11 @@ static void print_summary(struct lscpu_cxt *cxt) } if (ct && ct->addrsz) add_summary_s(tb, sec, _("Address sizes:"), ct->addrsz); -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ - add_summary_s(tb, sec, _("Byte Order:"), "Little Endian"); -#else - add_summary_s(tb, sec, _("Byte Order:"), "Big Endian"); -#endif + + if (sysfs_get_byteorder() == SYSFS_BYTEORDER_LITTLE) + add_summary_s(tb, sec, _("Byte Order:"), "Little Endian"); + else + add_summary_s(tb, sec, _("Byte Order:"), "Big Endian"); /* Section: CPU lists */ sec = add_summary_n(tb, NULL, _("CPU(s):"), cxt->npresents);