]> git.ipfire.org Git - thirdparty/xz.git/commitdiff
liblzma: ARM64 CRC32: Change style of the macOS code to match FreeBSD
authorLasse Collin <lasse.collin@tukaani.org>
Wed, 10 Apr 2024 19:04:27 +0000 (22:04 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Wed, 10 Apr 2024 20:12:23 +0000 (23:12 +0300)
I didn't test this but it shouldn't change any functionality.

Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
src/liblzma/check/crc32_arm64.h

index 68e7fcdd51bf876c832fad84906087e6d36f69cc..39c1c63ec0eced25ad5042e1611ecd8064831d8d 100644 (file)
@@ -101,10 +101,11 @@ is_arch_extension_supported(void)
        // CPU feature it tests. The Apple documentation lists the string
        // "hw.optional.armv8_crc32", which can be found here:
        // https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics#3915619
-       int err = sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
-                       &size, NULL, 0);
+       if (sysctlbyname("hw.optional.armv8_crc32", &has_crc32,
+                       &size, NULL, 0) != 0)
+               return false;
 
-       return !err && has_crc32;
+       return has_crc32;
 
 #else
        // If a runtime detection method cannot be found, then this must