From 4e75b40d8a96c5d51490ddea43566fe8e6d4168c Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 9 Apr 2022 02:28:05 +0000 Subject: Prepare for 2.12.0.0. librandom revamp. Signed-off-by: Laurent Bercot --- src/librandom/random_string.c | 60 ------------------------------------------- 1 file changed, 60 deletions(-) delete mode 100644 src/librandom/random_string.c (limited to 'src/librandom/random_string.c') diff --git a/src/librandom/random_string.c b/src/librandom/random_string.c deleted file mode 100644 index acdec69..0000000 --- a/src/librandom/random_string.c +++ /dev/null @@ -1,60 +0,0 @@ -/* ISC license. */ - -#include - -#ifdef SKALIBS_HASARC4RANDOM - -#include -#include -#include - -void random_string (char *s, size_t n) -{ - arc4random_buf(s, n) ; -} - -#else -#ifdef SKALIBS_HASGETRANDOM - -#include -#include - -void random_string (char *s, size_t n) -{ - while (n) - { - ssize_t r = getrandom(s, n, 0) ; - if (r >= 0) - { - s += r ; - n -= r ; - } - } -} - -#else -#ifdef SKALIBS_HASDEVURANDOM - -#include -#include -#include "random-internal.h" - -void random_string (char *s, size_t n) -{ - size_t r = allread(random_fd, s, n) ; - if (r < n) surf(&surf_here, s+r, n-r) ; -} - -#else /* default */ - -#include -#include "random-internal.h" - -void random_string (char *s, size_t n) -{ - surf(&surf_here, s, n) ; -} - -#endif -#endif -#endif -- cgit v1.3.1