liblzma: ARM64 CRC32: Add error checking to FreeBSD-specific code

Also add parenthesis to the return statement.

I didn't test this.

Fixes: 761f5b69a4
This commit is contained in:
Lasse Collin 2024-04-10 21:59:27 +03:00
parent 2337f7021c
commit 1024cd4cd9
1 changed files with 4 additions and 2 deletions

View File

@ -84,8 +84,10 @@ is_arch_extension_supported(void)
#elif defined(HAVE_ELF_AUX_INFO) #elif defined(HAVE_ELF_AUX_INFO)
unsigned long feature_flags; unsigned long feature_flags;
elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)); if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0)
return feature_flags & HWCAP_CRC32 != 0; return false;
return (feature_flags & HWCAP_CRC32) != 0;
#elif defined(_WIN32) #elif defined(_WIN32)
return IsProcessorFeaturePresent( return IsProcessorFeaturePresent(