This commit is contained in:
Frank Denis 2017-01-18 20:03:26 +01:00
parent f053b98b64
commit de3c0ff85e
2 changed files with 17 additions and 17 deletions

View File

@ -6,11 +6,11 @@
# include <sys/time.h>
#endif
#ifdef __linux__
#ifdef __dietlibc__
#define _LINUX_SOURCE
#else
# include <sys/syscall.h>
#endif
# ifdef __dietlibc__
# define _LINUX_SOURCE
# else
# include <sys/syscall.h>
# endif
# include <poll.h>
#endif
@ -219,11 +219,11 @@ _randombytes_linux_getrandom(void * const buf, const size_t size)
assert(size <= 256U);
do {
#ifdef __dietlibc__
# ifdef __dietlibc__
readnb = getrandom(buf, size, 0);
#else
# else
readnb = syscall(SYS_getrandom, buf, (int) size, 0);
#endif
# endif
} while (readnb < 0 && (errno == EINTR || errno == EAGAIN));
return (readnb == (int) size) - 1;

View File

@ -6,11 +6,11 @@
# include <sys/time.h>
#endif
#ifdef __linux__
#ifdef __dietlibc__
#define _LINUX_SOURCE
#else
# include <sys/syscall.h>
#endif
# ifdef __dietlibc__
# define _LINUX_SOURCE
# else
# include <sys/syscall.h>
# endif
# include <poll.h>
#endif
@ -201,11 +201,11 @@ _randombytes_linux_getrandom(void * const buf, const size_t size)
assert(size <= 256U);
do {
#ifdef __dietlibc__
readnb = getrandom( buf, size, 0);
#else
# ifdef __dietlibc__
readnb = getrandom(buf, size, 0);
# else
readnb = syscall(SYS_getrandom, buf, (int) size, 0);
#endif
# endif
} while (readnb < 0 && (errno == EINTR || errno == EAGAIN));
return (readnb == (int) size) - 1;