From b4b810d2013cff2c3331db51ccd42c2d8c392cea Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Fri, 12 Jan 2024 16:48:49 +0000 Subject: [PATCH] stress-crypt: fix FreeBSD build issues FreeBSD has crypt() and associated crypt structs declared in so fix libcrypt detection and builds for FreeBSD to not use Signed-off-by: Colin Ian King --- stress-crypt.c | 3 ++- test/test-libcrypt.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/stress-crypt.c b/stress-crypt.c index e71dad185..7c87207c3 100644 --- a/stress-crypt.c +++ b/stress-crypt.c @@ -31,7 +31,8 @@ static const stress_help_t help[] = { }; #if defined(HAVE_LIB_CRYPT) && \ - defined(HAVE_CRYPT_H) + (defined(HAVE_CRYPT_H) || \ + defined(__FreeBSD__)) typedef struct { const char *prefix; diff --git a/test/test-libcrypt.c b/test/test-libcrypt.c index 85f9336d1..50d2d8960 100644 --- a/test/test-libcrypt.c +++ b/test/test-libcrypt.c @@ -21,7 +21,11 @@ #define _XOPEN_SOURCE 600 #include +#if defined(__FreeBSD__) +#include +#else #include +#endif int main(void) {