]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
configure: don't check for getrandom when arc4random is present
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 5 Oct 2020 14:17:45 +0000 (16:17 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 5 Oct 2020 16:56:37 +0000 (18:56 +0200)
On FreeBSD 12, both functions seem to be available. Prefer arc4random.

configure

index c9d0e6011f3df75e7f93bd1c0ec524e07839c7c6..845b096283c8612c2874b599920880aee0fcedce 100755 (executable)
--- a/configure
+++ b/configure
@@ -689,11 +689,11 @@ fi
 
 if test_code 'arc4random_buf()' 'stdlib.h' '' '' 'arc4random_buf(NULL, 0);'; then
   add_def HAVE_ARC4RANDOM
-fi
-
-if test_code 'getrandom()' 'stdlib.h sys/random.h' '' '' \
-    'return getrandom(NULL, 256, 0);'; then
-  add_def HAVE_GETRANDOM
+else
+  if test_code 'getrandom()' 'stdlib.h sys/random.h' '' '' \
+      'return getrandom(NULL, 256, 0);'; then
+    add_def HAVE_GETRANDOM
+  fi
 fi
 
 RECVMMSG_CODE='