]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lscpu: use runtime byteorder
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 30 Oct 2022 15:06:37 +0000 (16:06 +0100)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 25 Nov 2022 18:20:32 +0000 (19:20 +0100)
sys-utils/lscpu.c

index 85ef5abcbbaaa3e6e8c1407655cc25cacb36f4e9..080c9f6e9c1112a12aa37c0d52f30a7f3f719a88 100644 (file)
@@ -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);