From: Azat Khuzhin Date: Mon, 27 Mar 2017 12:50:23 +0000 (+0300) Subject: Fix arc4random_addrandom() detecting and fallback (regression) X-Git-Tag: release-2.1.9-beta^2~187 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=303d6d77c7d66a69462d500857480f7e265eac07;p=libevent Fix arc4random_addrandom() detecting and fallback (regression) But this is kind of hot-fix, we definitelly need more sane arc4random compat layer. Fixes: #488 Introduced-in: 6541168 ("Detect arch4random_addrandom() existence") (cherry picked from commit 266f43af7798befa3d27bfabaa9ae699259c3924) --- diff --git a/event-config.h.cmake b/event-config.h.cmake index b7f0be57..5c233a3d 100644 --- a/event-config.h.cmake +++ b/event-config.h.cmake @@ -53,6 +53,9 @@ /* Define to 1 if you have the `arc4random_buf' function. */ #cmakedefine EVENT__HAVE_ARC4RANDOM_BUF 1 +/* Define to 1 if you have the `arc4random_addrandom' function. */ +#cmakedefine EVENT__HAVE_ARC4RANDOM_ADDRANDOM 1 + /* Define if clock_gettime is available in libc */ #cmakedefine EVENT__DNS_USE_CPU_CLOCK_FOR_ID 1 diff --git a/include/event2/util.h b/include/event2/util.h index c4af2bd6..ca404894 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -842,7 +842,7 @@ int evutil_secure_rng_init(void); EVENT2_EXPORT_SYMBOL int evutil_secure_rng_set_urandom_device_file(char *fname); -#ifdef EVENT__HAVE_ARC4RANDOM_ADDRANDOM +#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM) /** Seed the random number generator with extra random bytes. You should almost never need to call this function; it should be