mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Merge 1d64dfe4fa into merged_master (Bitcoin PR #18364)
This commit is contained in:
commit
a6dc11ab7a
1 changed files with 5 additions and 8 deletions
|
|
@ -15,7 +15,7 @@
|
|||
#endif
|
||||
#include <logging.h> // for LogPrintf()
|
||||
#include <sync.h> // for Mutex
|
||||
#include <util/time.h> // for GetTime()
|
||||
#include <util/time.h> // for GetTimeMicros()
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <thread>
|
||||
|
|
@ -315,13 +315,10 @@ void GetOSRand(unsigned char *ent32)
|
|||
RandFailure();
|
||||
}
|
||||
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
||||
// We need a fallback for OSX < 10.12
|
||||
if (&getentropy != nullptr) {
|
||||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||
RandFailure();
|
||||
}
|
||||
} else {
|
||||
GetDevURandom(ent32);
|
||||
/* getentropy() is available on macOS 10.12 and later.
|
||||
*/
|
||||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||
RandFailure();
|
||||
}
|
||||
#elif defined(HAVE_SYSCTL_ARND)
|
||||
/* FreeBSD and similar. It is possible for the call to return less
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue