]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bootctl: avoid using __WORDSIZE macro
authorMike Gilbert <floppym@gentoo.org>
Tue, 14 Feb 2023 19:46:25 +0000 (14:46 -0500)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 15 Feb 2023 01:24:25 +0000 (10:24 +0900)
__WORDSIZE does not seem to be documented anywhere, and is probably
meant to be used internally by glibc headers.

In systemd, it was only being used in warning messages. We can avoid
using it by rewording the messages slightly.

Fixes a build error with musl libc.

Bug: https://bugs.gentoo.org/894430

src/boot/bootctl-util.c

index f89721244ac96f9101a688998458c28d34d42ea5..62c0b64406d272622b58a7550ad78a88909e64d5 100644 (file)
@@ -41,7 +41,9 @@ const char *get_efi_arch(void) {
         if (r == -ENOENT)
                 return EFI_MACHINE_TYPE_NAME;
         if (r < 0) {
-                log_warning_errno(r, "Error reading EFI firmware word size, assuming '%i': %m", __WORDSIZE);
+                log_warning_errno(r,
+                        "Error reading EFI firmware word size, assuming machine type '%s': %m",
+                        EFI_MACHINE_TYPE_NAME);
                 return EFI_MACHINE_TYPE_NAME;
         }
 
@@ -51,9 +53,9 @@ const char *get_efi_arch(void) {
                 return "ia32";
 
         log_warning(
-                "Unknown EFI firmware word size '%s', using default word size '%i' instead.",
+                "Unknown EFI firmware word size '%s', using machine type '%s'.",
                 platform_size,
-                __WORDSIZE);
+                EFI_MACHINE_TYPE_NAME);
 #endif
 
         return EFI_MACHINE_TYPE_NAME;