aboutsummaryrefslogtreecommitdiffstats
path: root/util-src/crand.c
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-12-01 00:27:37 +0100
committerKim Alvefur <zash@zash.se>2017-12-01 00:27:37 +0100
commitac6e7808c2d2c173b5ee72ede108031094d4f07f (patch)
treeb0a925408c2a68e373fae701030287aa33110829 /util-src/crand.c
parentf39981045f036ca25a7263317bf02174a58004bd (diff)
downloadprosody-ac6e7808c2d2c173b5ee72ede108031094d4f07f.tar.gz
prosody-ac6e7808c2d2c173b5ee72ede108031094d4f07f.zip
util.crand: Always include stdlib to be sure __GLIBC_PREREQ is defined
Diffstat (limited to 'util-src/crand.c')
-rw-r--r--util-src/crand.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/util-src/crand.c b/util-src/crand.c
index 7eea1f2b..51d934c8 100644
--- a/util-src/crand.c
+++ b/util-src/crand.c
@@ -21,6 +21,8 @@
#define _DEFAULT_SOURCE
+#include <stdlib.h>
+
#include "lualib.h"
#include "lauxlib.h"
@@ -49,11 +51,9 @@ int getrandom(void *buf, size_t buflen, unsigned int flags) {
#include <sys/random.h>
#endif
-#elif defined(WITH_ARC4RANDOM)
-#include <stdlib.h>
#elif defined(WITH_OPENSSL)
#include <openssl/rand.h>
-#else
+#elif ! defined(WITH_ARC4RANDOM)
#error util.crand compiled without a random source
#endif