summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-26 02:14:09 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 06:59:42 +0000
commit8522b5c391db034f29adcedab000adf21c79d67a (patch)
tree072f9a29e12ffd6dfda152571246df740e57931c /util/libreboot-utils/lib/rand.c
parente151179d14876ecb808b2a077815fe7e3a312344 (diff)
more cleanup on rand.c
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib/rand.c')
-rw-r--r--util/libreboot-utils/lib/rand.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c
index ac94a482..3a0a94bf 100644
--- a/util/libreboot-utils/lib/rand.c
+++ b/util/libreboot-utils/lib/rand.c
@@ -20,6 +20,9 @@
#if defined(USE_URANDOM) && \
((USE_URANDOM) > 0)
#include <fcntl.h> /* if not arc4random: /dev/urandom */
+#elif defined(__linux__)
+#include <sys/random.h>
+#include <sys/syscall.h>
#endif
#include <fcntl.h>
@@ -70,7 +73,7 @@
*/
int
-win_lottery(void) /* are u lucky? */
+win_lottery(char **buf) /* are u lucky? */
{
size_t size = 0;
int rval;
@@ -84,6 +87,8 @@ win_lottery(void) /* are u lucky? */
else
rval = 0;
+ (void) scat(s1, s2, BUFSIZ << 1, buf);
+
free_if_null(&s1);
free_if_null(&s2);