aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-05-19 10:14:35 +0100
committerfanquake <fanquake@gmail.com>2023-05-20 17:09:47 +0100
commitc13c97dbf846cf0e6a5581ac414ef96a215b0dc6 (patch)
tree875497e498318070daf853977dd6e24744b66063 /src
parent17acb2782a66f033238340e4fb81009e7f79e97a (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/random.cpp3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/random.cpp b/src/random.cpp
index f4c51574cc..144a5c5318 100644
--- a/src/random.cpp
+++ b/src/random.cpp
@@ -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();
}