Skip to content

Guard "sys/random.h" with HAVE_GETENTROPY #5283

@olegrok

Description

@olegrok

After 59b2f66 compilation on e.g. centos:7 started to fail on "sys/random.h".

Fix is quite straightforward:

diff --git a/src/rdrand.c b/src/rdrand.c
index 77d02cfc..ad388e2a 100644
--- a/src/rdrand.c
+++ b/src/rdrand.c
@@ -32,10 +32,12 @@
 #include "tinycthread.h"
 #include "rdmurmur2.h"
 #ifndef _WIN32
+#ifdef HAVE_GETENTROPY
 /* getentropy() can be present in one of these two */
 #include <unistd.h>
 #include <sys/random.h>
 #endif
+#endif
 
 #ifdef HAVE_OSSL_SECURE_RAND_BYTES
 #include <openssl/rand.h>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions