summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib/rand.c
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-29 14:15:34 +0100
committerLeah Rowe <leah@libreboot.org>2026-03-29 14:15:34 +0100
commitac04a5f50abdbf241d14bce845051051eb80b137 (patch)
treecfded5c593ca2ca6edb3574685f648795450b8e6 /util/libreboot-utils/lib/rand.c
parenta56903a7b04e7f0a563850b8607261ce60cd9e1e (diff)
libreboot-utils/lib: loop eintr on [p]read/[p]write
i forgot to do this! with this, I/O should be bullet proof now. i already loop this on other I/O commands. 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.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/util/libreboot-utils/lib/rand.c b/util/libreboot-utils/lib/rand.c
index 2aa0de3a..9da8d9eb 100644
--- a/util/libreboot-utils/lib/rand.c
+++ b/util/libreboot-utils/lib/rand.c
@@ -150,7 +150,8 @@ rset(void *buf, size_t n)
int fd = -1;
open_on_eintr("/dev/urandom", &fd, O_RDONLY, 0400, NULL);
retry_rand:
- if ((rc = read(fd, (unsigned char *)buf + off, n - off)) < 0) {
+ if ((rc = read_on_eintr(fd,
+ (unsigned char *)buf + off, n - off)) < 0) {
#elif defined(__linux__)
retry_rand:
if ((rc = (ssize_t)syscall(SYS_getrandom,