From: Pauli Date: Mon, 31 Mar 2025 02:01:22 +0000 (+1100) Subject: rand: avoid unused function warning for FreeBSD and NetBSD. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0fe8784131f786de8fa4a52fe559eae0c32903ca;p=thirdparty%2Fopenssl.git rand: avoid unused function warning for FreeBSD and NetBSD. The existing checks were not sufficiently version specific. Reviewed-by: Tom Cosgrove Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/27204) --- diff --git a/providers/implementations/rands/seeding/rand_unix.c b/providers/implementations/rands/seeding/rand_unix.c index c3a5d8b3bf2..bd21acf2bcb 100644 --- a/providers/implementations/rands/seeding/rand_unix.c +++ b/providers/implementations/rands/seeding/rand_unix.c @@ -211,7 +211,9 @@ void ossl_rand_pool_keep_random_devices_open(int keep) # define OPENSSL_RAND_SEED_DEVRANDOM # endif -# if (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND) +# if ((defined(__FreeBSD__) && __FreeBSD_version < 1200061) \ + || (defined(__NetBSD__) && __NetBSD_Version < 1000000000)) \ + && defined(KERN_ARND) /* * sysctl_random(): Use sysctl() to read a random number from the kernel * Returns the number of bytes returned in buf on success, -1 on failure.