add preprocessor flag to skip blocking /dev/random during libsodium init (#429)

This commit is contained in:
Robert Spychala
2016-09-20 21:13:07 +02:00
committed by Frank Denis
parent 6e2b119d86
commit 94ea419247
2 changed files with 4 additions and 4 deletions
@@ -130,7 +130,7 @@ safe_read(const int fd, void * const buf_, size_t size)
#endif
#ifndef _WIN32
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
static int
randombytes_block_on_dev_random(void)
{
@@ -172,7 +172,7 @@ randombytes_salsa20_random_random_dev_open(void)
const char ** device = devices;
int fd;
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
if (randombytes_block_on_dev_random() != 0) {
return -1;
}
@@ -114,7 +114,7 @@ safe_read(const int fd, void * const buf_, size_t size)
#endif
#ifndef _WIN32
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
static int
randombytes_block_on_dev_random(void)
{
@@ -155,7 +155,7 @@ randombytes_sysrandom_random_dev_open(void)
const char ** device = devices;
int fd;
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM)
# if defined(__linux__) && !defined(USE_BLOCKING_RANDOM) && !defined(NO_BLOCKING_RANDOM_POLL)
if (randombytes_block_on_dev_random() != 0) {
return -1;
}