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>
This commit is contained in:
Leah Rowe
2026-03-29 14:15:34 +01:00
parent a56903a7b0
commit ac04a5f50a
3 changed files with 121 additions and 7 deletions
+2 -1
View File
@@ -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,