]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
nvme-print: add fallback for non-standard locale category
authorDaniel Néri <dne+commits@rb67.eu>
Mon, 11 Nov 2024 22:06:03 +0000 (23:06 +0100)
committerDaniel Wagner <wagi@monom.org>
Tue, 12 Nov 2024 07:19:29 +0000 (08:19 +0100)
LC_MEASUREMENT is a GNU (libc) extension - fall back to LC_ALL if it's
not defined.

Fixes build with musl libc

Signed-off-by: Daniel Néri <dne+commits@rb67.eu>
nvme-print.c

index 170e5c12fb223053f2cce91b9834ebab8b5c2ed7..5b1f2e827aef0027f0b7c81166e7fda5d3cf2307 100644 (file)
@@ -797,6 +797,10 @@ static bool is_fahrenheit_country(const char *country)
        return false;
 }
 
+#ifndef LC_MEASUREMENT
+#define LC_MEASUREMENT LC_ALL
+#endif
+
 static bool is_temperature_fahrenheit(void)
 {
        const char *locale, *underscore;