mirror of
https://github.com/bjc/prosody.git
synced 2025-04-03 05:07:42 +03:00
util.crand: Make it possible to use arc4random on Linux (needs libbsd)
This commit is contained in:
parent
da570eb0a4
commit
abb425e70f
2 changed files with 7 additions and 1 deletions
2
configure
vendored
2
configure
vendored
|
@ -528,6 +528,8 @@ OPENSSL_LIBS="-l$OPENSSL_LIB"
|
|||
|
||||
if [ "$PRNG" = "OPENSSL" ]; then
|
||||
PRNGLIBS=$OPENSSL_LIBS
|
||||
elif [ "$PRNG" = "ARC4RANDOM" -a "$(uname)" = "Linux" ]; then
|
||||
PRNGLIBS="-lbsd"
|
||||
fi
|
||||
|
||||
# Write config
|
||||
|
|
|
@ -54,7 +54,11 @@ int getrandom(void *buf, size_t buflen, unsigned int flags) {
|
|||
|
||||
#elif defined(WITH_OPENSSL)
|
||||
#include <openssl/rand.h>
|
||||
#elif ! defined(WITH_ARC4RANDOM)
|
||||
#elif defined(WITH_ARC4RANDOM)
|
||||
#ifdef __linux__
|
||||
#include <bsd/stdlib.h>
|
||||
#endif
|
||||
#else
|
||||
#error util.crand compiled without a random source
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue