From d1ae8db86bb87237027692c92167c9c5d721c5a2 Mon Sep 17 00:00:00 2001 From: woahwhattheheck Date: Sun, 20 Sep 2026 23:24:44 -0400 Subject: [PATCH] entropy: retry interrupted urandom reads --- libcperciva/util/entropy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libcperciva/util/entropy.c b/libcperciva/util/entropy.c index d9454ee4..e84b2c2f 100644 --- a/libcperciva/util/entropy.c +++ b/libcperciva/util/entropy.c @@ -77,6 +77,8 @@ entropy_read_fill(struct entropy_read_cookie * er, uint8_t * buf, /* Read bytes until we have filled the buffer. */ while (buflen > 0) { if ((lenread = read(er->fd, buf, buflen)) == -1) { + if (errno == EINTR) + continue; warnp("read(/dev/urandom)"); goto err0; }