mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
random: getentropy on macOS does not need unistd.h
Remove it. Make this change, so in a future commit, we can combine #ifdefs, and avoid duplicate <sys/random.h> includes once we switch to using getrandom directly. Also remove the comment about macOS 10.12. We already require macOS > 10.15, so it is redundant.
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
#include <linux/random.h>
|
||||
#endif
|
||||
#if defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
||||
#include <unistd.h>
|
||||
#include <sys/random.h>
|
||||
#endif
|
||||
#ifdef HAVE_SYSCTL_ARND
|
||||
@@ -314,8 +313,6 @@ void GetOSRand(unsigned char *ent32)
|
||||
// Silence a compiler warning about unused function.
|
||||
(void)GetDevURandom;
|
||||
#elif defined(HAVE_GETENTROPY_RAND) && defined(MAC_OSX)
|
||||
/* getentropy() is available on macOS 10.12 and later.
|
||||
*/
|
||||
if (getentropy(ent32, NUM_OS_RANDOM_BYTES) != 0) {
|
||||
RandFailure();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user